Revision acee3e3e
Added by Leszek Koltunski 11 months ago
src/main/java/org/distorted/main/MainActivity.java | ||
---|---|---|
465 | 465 |
|
466 | 466 |
int vw = v.getWidth(); |
467 | 467 |
|
468 |
MainSettingsPopup popup = new MainSettingsPopup(this,mScreenWidth,mScreenHeight); |
|
468 |
MainSettingsPopup popup = new MainSettingsPopup(this,mSortMode,mScreenWidth,mScreenHeight);
|
|
469 | 469 |
popup.displayPopup(this,v,sw,sh,(int)((vw-sw)/2),0); |
470 | 470 |
} |
471 | 471 |
|
src/main/java/org/distorted/main/MainSettingsPopup.java | ||
---|---|---|
82 | 82 |
|
83 | 83 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
84 | 84 |
|
85 |
MainSettingsPopup(MainActivity act, int width, int height) |
|
85 |
MainSettingsPopup(MainActivity act, int sortMethod, int width, int height)
|
|
86 | 86 |
{ |
87 | 87 |
mAct = new WeakReference<>(act); |
88 | 88 |
|
... | ... | |
108 | 108 |
Spinner actSpinner = layout.findViewById(R.id.sortMethod); |
109 | 109 |
actSpinner.setOnItemSelectedListener(this); |
110 | 110 |
|
111 |
mCurrMethod = -1;
|
|
111 |
mCurrMethod = sortMethod;
|
|
112 | 112 |
|
113 | 113 |
ArrayAdapter<String> actAdapter = new ArrayAdapter<>(act, android.R.layout.simple_spinner_item, mSortNames); |
114 | 114 |
actAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
115 | 115 |
actSpinner.setAdapter(actAdapter); |
116 |
|
|
117 |
if( sortMethod>=0 && sortMethod<mSortNames.length ) actSpinner.setSelection(sortMethod); |
|
116 | 118 |
} |
117 | 119 |
|
118 | 120 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
172 | 174 |
mCurrMethod = pos; |
173 | 175 |
MainActivity act = mAct.get(); |
174 | 176 |
act.sortObjectsBy(pos); |
177 |
mPopup.dismiss(); |
|
175 | 178 |
} |
176 | 179 |
} |
177 | 180 |
|
Also available in: Unified diff
progress