Fixing messed up dark theme

This commit is contained in:
arpit khurana
2014-10-03 18:41:04 +05:30
parent 51ec4876b4
commit 378fdfbabe
6 changed files with 9 additions and 41 deletions
+4 -3
View File
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/main_frag"
android:layout_height="match_parent"
android:background="#e6e6e6">
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e6e6e6" />
android:layout_height="match_parent" />
<GridView
android:id="@+id/gridView"
+1
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DarkTheme" parent="android:Theme.Holo">
<item name="android:windowTranslucentStatus">true</item>
</style>
<style name="LightTheme" parent="android:Theme.Holo.Light.DarkActionBar">
-17
View File
@@ -61,12 +61,6 @@
android:entryValues="@array/ints2"
android:key="sortby"
android:title="@string/sortby" />
<ListPreference
android:defaultValue="1"
android:entries="@array/folder"
android:entryValues="@array/ints1"
android:key="folder"
android:title="@string/foldercolor" />
<CheckBoxPreference
android:defaultValue="false"
android:key="rootmode"
@@ -75,15 +69,4 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/imagegallery">
<EditTextPreference
android:key="Ipath"
android:title="@string/changegallerypath" />
   
<CheckBoxPreference
android:defaultValue="true"
android:key="Ipathset"
android:title="@string/usedefaultgallerypath"/>
</PreferenceCategory>
</PreferenceScreen>
@@ -24,7 +24,7 @@ public class Preferences extends Activity {
super.onCreate(savedInstanceState);
setContentView(R.layout.prefsfrag);
String skin = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("skin_color", "#009688");
String skin = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("skin_color", "#607d8b");
getActionBar().setIcon(R.drawable.ic_launcher1);
getActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(skin)));
getActionBar().setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
@@ -112,13 +112,13 @@ public class Main extends android.support.v4.app.Fragment {
private ArrayAdapter<String> adapter1;
private MainActivity mainActivity;
private String skin;
int theme;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
aBoolean = Sp.getBoolean("view", true);
theme=Integer.parseInt(Sp.getString("theme","0"));
mainActivity=(MainActivity)getActivity();
tabHandler = new TabHandler(getActivity(), null, null, 1);
showPermissions=Sp.getBoolean("showPermissions",false);
@@ -143,6 +143,7 @@ public class Main extends android.support.v4.app.Fragment {
gridView = (GridView) rootView.findViewById(R.id.gridView);
showThumbs=Sp.getBoolean("showThumbs",true);
ic=new IconHolder(getActivity(),showThumbs,!aBoolean);
if(theme==1)rootView.findViewById(R.id.main_frag).setBackgroundColor(getResources().getColor(android.R.color.background_dark));
if (aBoolean) {
listView.setVisibility(View.VISIBLE);
gridView.setVisibility(View.GONE);
@@ -27,7 +27,6 @@ public class Preffrag extends PreferenceFragment {
addPreferencesFromResource(R.xml.preferences);
final SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());
final EditTextPreference b = (EditTextPreference) findPreference("Ipath");
final ListPreference ui = (ListPreference) findPreference("uimode");
int vl = Integer.parseInt(sharedPref.getString("theme", "0"));
if (vl == 1) {
@@ -155,23 +154,6 @@ public class Preffrag extends PreferenceFragment {
}
});
final CheckBoxPreference a = (CheckBoxPreference) findPreference("Ipathset");
b.setEnabled(!a.isChecked());
a.setOnPreferenceChangeListener(new CheckBoxPreference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference p1, Object p2) {
if (a.isChecked()) {
b.setEnabled(true);
} else {
b.setEnabled(false);
sharedPref.edit().putString("Ipath", Environment.getExternalStorageDirectory().getPath() + "/" + Environment.DIRECTORY_DCIM).commit();
}
// TODO: Implement this method
return true;
}
});
final CheckBoxPreference rootmode = (CheckBoxPreference) findPreference("rootmode");
rootmode.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override