Comments (6)
Did u try with DialogFragment ?
from pickerview.
yes, the dialog is DialogFragment.
from pickerview.
I faced same problem. How to solve it?
from pickerview.
@llouiskhenghao @CongBaDo Can u please Post Your Code For ?
from pickerview.
This is DialogFragment with Picker
`public class FilterDialogFragment extends DialogFragment {
private String[] filters;
public FilterDialogFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_filter, container);
getDialog().getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
getDialog().setTitle("Please enter username");
CustomizedTextView customizedTextView = (CustomizedTextView)view.findViewById(R.id.tv_nationality_title);
filters = getResources().getStringArray(R.array.filters);
List<String> filterList = Arrays.asList(filters);
LinearLayout llLocation = (LinearLayout)view.findViewById(R.id.ll_location);
LinearLayout llRentType = (LinearLayout)view.findViewById(R.id.ll_rent_type);
LinearLayout llBudget = (LinearLayout)view.findViewById(R.id.ll_budget);
LinearLayout llNationality = (LinearLayout)view.findViewById(R.id.ll_nationality);
LinearLayout llGender = (LinearLayout)view.findViewById(R.id.ll_gender);
LinearLayout llAvailable = (LinearLayout)view.findViewById(R.id.ll_available_date);
llLocation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showPickerView(1, getActivity());
}
});
llRentType.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showPickerView(4, getActivity());
}
});
llBudget.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showPickerView(4, getActivity());
}
});
llNationality.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showPickerView(2, getActivity());
}
});
llGender.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showPickerView(4, getActivity());
}
});
return view;
}
private void showPickerView(int i, final Context context){
MyOptionsPickerView singlePicker = new MyOptionsPickerView(context);
final ArrayList<String> items = new ArrayList<String>();
if(i == 1){
List<ItemLocation> locationList = CoreManager.getInstance().getItemLocationList();
for(int m =0; m < locationList.size(); m++){
items.add(locationList.get(m).name);
}
}else if(i == 2){
List<ItemCountry> locationList = CoreManager.getInstance().getItemCountryList();
for(int m =0; m < locationList.size(); m++){
items.add(locationList.get(m).name);
}
}else if(i == 3){
for(int m =0; m < 20; m++){
items.add(String.valueOf(m+1));
}
}else if(i == 4){
List<ItemBudget> budgets = CoreManager.getInstance().getItemBudgetList();
for(int m = 0; m < budgets.size(); m++){
items.add(budgets.get(m).min +" - "+budgets.get(m).min);
}
}else if(i == 5){
}
singlePicker.setPicker(items);
singlePicker.setTitle(filters[i]);
singlePicker.setCyclic(false);
singlePicker.setSelectOptions(0);
singlePicker.setOnoptionsSelectListener(new MyOptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int option2, int options3) {
Toast.makeText(context, "" + items.get(options1), Toast.LENGTH_SHORT).show();
}
});
singlePicker.show();
}
}`
from pickerview.
Any Solution?
from pickerview.
Related Issues (15)
- Add information about licensing HOT 2
- i18n support HOT 1
- Taps are not recognized correctly HOT 2
- Need Item Change Listener
- pickerview is not hiding while back press in fragment ?? HOT 1
- Dialog is not opening . HOT 1
- How to return custom array list class in pickerview?
- How to change Submit and Cancel button text color and size? HOT 1
- 没有联动效果 HOT 1
- Setting text size for picker items. HOT 6
- How to change the font color and font style and size HOT 3
- I have a demand like this.
- How to use double picker HOT 1
- Not shure about licence HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pickerview.