An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!
Apache License 2.0
11.07k
stars
5.03k
forks
source link
update SlidingMenu Mode from another Fragment #756
I have a SettingFragment that contains options to change app language, for example when I change language to french I must set the menu to the LEFT ;setMode(SlidingMenu.LEFT), and when I change it to arabic I must set the languague to the RIGHT setMode(SlidingMenu.RIGHT).
To achieve taht I use the observer pattern as following :
MainActivity extends FragmentActivity {
....
@Override
public void propertyChange(PropertyChangeEvent event) {
final String mLanguge = (String) event.getNewValue();
Log.v("Langue",mLanguge );
MainMenuActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if(mLanguge .equals(getResources().getString(R.string.params_arabe_key_pref)))
menu.setMode(SlidingMenu.RIGHT);
else
menu.setMode(SlidingMenu.LEFT);
// refresh the SlidingMenu
menu.invalidate();
}
});
}
(Note this methode is declared inside the MainActivity and it's called when the user change the app language)
Hi,
I have a
SettingFragment
that contains options to change app language, for example when I change language to french I must set the menu to the LEFT ;setMode(SlidingMenu.LEFT)
, and when I change it to arabic I must set the languague to the RIGHTsetMode(SlidingMenu.RIGHT)
.To achieve taht I use the observer pattern as following :
(Note this methode is declared inside the
MainActivity
and it's called when the user change the app language)