Storage selection dialog works in nightmode #463

This commit is contained in:
mhutti1 2017-02-21 23:31:26 +00:00
parent 75a1c3fa0e
commit 4014b24474
3 changed files with 10 additions and 5 deletions

View File

@ -50,7 +50,7 @@ dependencies {
compile 'io.reactivex:rxandroid:1.1.0'
compile 'io.reactivex:rxjava:1.1.3'
compile 'eu.mhutti1.utils.storage:android-storage-devices:0.4.7'
compile 'eu.mhutti1.utils.storage:android-storage-devices:0.4.8'
compile 'com.jakewharton:butterknife:8.0.1'
apt 'com.jakewharton:butterknife-compiler:8.0.1'

View File

@ -50,6 +50,7 @@ import org.kiwix.kiwixmobile.library.LibraryAdapter;
import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity;
import org.kiwix.kiwixmobile.network.KiwixService;
import org.kiwix.kiwixmobile.utils.StorageUtils;
import org.kiwix.kiwixmobile.utils.StyleUtils;
import eu.mhutti1.utils.storage.StorageDevice;
import eu.mhutti1.utils.storage.StorageSelectDialog;
@ -203,8 +204,9 @@ public class LibraryFragment extends Fragment implements AdapterView.OnItemClick
FragmentManager fm = getFragmentManager();
StorageSelectDialog dialogFragment = new StorageSelectDialog();
Bundle b = new Bundle();
b.putString("INTERNAL", getResources().getString(R.string.internal_storage));
b.putString("EXTERNAL", getResources().getString(R.string.external_storage));
b.putString(StorageSelectDialog.STORAGE_DIALOG_INTERNAL, getResources().getString(R.string.internal_storage));
b.putString(StorageSelectDialog.STORAGE_DIALOG_EXTERNAL, getResources().getString(R.string.external_storage));
b.putInt(StorageSelectDialog.STORAGE_DIALOG_THEME, StyleUtils.dialogStyle());
dialogFragment.setArguments(b);
dialogFragment.setOnSelectListener(this);
dialogFragment.show(fm, getResources().getString(R.string.pref_storage));

View File

@ -51,6 +51,7 @@ import org.kiwix.kiwixmobile.database.KiwixDatabase;
import org.kiwix.kiwixmobile.database.RecentSearchDao;
import org.kiwix.kiwixmobile.utils.DimenUtils;
import org.kiwix.kiwixmobile.utils.LanguageUtils;
import org.kiwix.kiwixmobile.utils.StyleUtils;
import org.kiwix.kiwixmobile.views.SliderPreference;
import static org.kiwix.kiwixmobile.utils.StyleUtils.dialogStyle;
@ -261,6 +262,7 @@ public class KiwixSettingsActivity extends AppCompatActivity {
}
if (key.equals(PREF_NIGHTMODE)) {
KiwixMobileActivity.refresh = true;
KiwixMobileActivity.nightMode = sharedPreferences.getBoolean(PREF_NIGHTMODE, false);
getActivity().recreate();
}
@ -312,8 +314,9 @@ public class KiwixSettingsActivity extends AppCompatActivity {
FragmentManager fm = getFragmentManager();
StorageSelectDialog dialogFragment = new StorageSelectDialog();
Bundle b = new Bundle();
b.putString("INTERNAL", getResources().getString(R.string.internal_storage));
b.putString("EXTERNAL", getResources().getString(R.string.external_storage));
b.putString(StorageSelectDialog.STORAGE_DIALOG_INTERNAL, getResources().getString(R.string.internal_storage));
b.putString(StorageSelectDialog.STORAGE_DIALOG_EXTERNAL, getResources().getString(R.string.external_storage));
b.putInt(StorageSelectDialog.STORAGE_DIALOG_THEME, StyleUtils.dialogStyle());
dialogFragment.setArguments(b);
dialogFragment.setOnSelectListener(this);
dialogFragment.show(fm, getResources().getString(R.string.pref_storage));