Revert all Light Theme changes

Should be done differently. Light theme before Holo is buggy.
This commit is contained in:
Daniel Martí 2013-09-01 14:03:55 +02:00
parent c2159456e2
commit 3741c0c62b
10 changed files with 11 additions and 89 deletions

View File

@ -29,7 +29,6 @@
android:name="FDroidApp" android:name="FDroidApp"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/AppTheme"
android:supportsRtl="false" > android:supportsRtl="false" >
<activity <activity
android:name="FDroid" android:name="FDroid"

View File

@ -1,11 +0,0 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppBaseTheme" parent="android:Theme.Holo">
<!-- API 11 theme customizations go here -->
</style>
<style name="AppBaseThemeLight" parent="android:Theme.Holo.Light">
<!-- API 11 theme customizations go here -->
</style>
</resources>

View File

@ -187,7 +187,5 @@
<string name="no_handler_app">You don\'t have any available app that can handle %s</string> <string name="no_handler_app">You don\'t have any available app that can handle %s</string>
<string name="compactlayout">Compact Layout</string> <string name="compactlayout">Compact Layout</string>
<string name="compactlayout_long">Only show app names and summaries in list</string> <string name="compactlayout_long">Only show app names and summaries in list</string>
<string name="lightTheme">Light Theme</string>
<string name="lightTheme_long">Use a light theme</string>
</resources> </resources>

View File

@ -1,19 +0,0 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppBaseTheme" parent="android:Theme.Black">
<!-- backward-compatibility theme options go here -->
</style>
<style name="AppBaseThemeLight" parent="android:Theme.Light">
<!-- backward-compatibility theme options go here -->
</style>
<style name="AppTheme" parent="AppBaseTheme">
<!-- customizations that are not API-level specific go here. -->
</style>
<style name="AppThemeLight" parent="AppBaseThemeLight">
<!-- customizations that are not API-level specific go here. -->
</style>
</resources>

View File

@ -23,9 +23,6 @@
<CheckBoxPreference android:title="@string/compactlayout" <CheckBoxPreference android:title="@string/compactlayout"
android:defaultValue="false" android:summary="@string/compactlayout_long" android:defaultValue="false" android:summary="@string/compactlayout_long"
android:key="compactlayout"/> android:key="compactlayout"/>
<CheckBoxPreference android:title="@string/lightTheme"
android:defaultValue="false" android:summary="@string/lightTheme_long"
android:key="lightTheme"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/antifeatures"> <PreferenceCategory android:title="@string/antifeatures">
<CheckBoxPreference android:title="@string/antiads" <CheckBoxPreference android:title="@string/antiads"

View File

@ -186,10 +186,6 @@ public class AppDetails extends ListActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
if (PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean("lightTheme", false))
setTheme(R.style.AppThemeLight);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ActionBarCompat abCompat = ActionBarCompat.create(this); ActionBarCompat abCompat = ActionBarCompat.create(this);
abCompat.setDisplayHomeAsUpEnabled(true); abCompat.setDisplayHomeAsUpEnabled(true);

View File

@ -33,7 +33,6 @@ import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.ResultReceiver; import android.os.ResultReceiver;
import android.preference.PreferenceManager;
import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.util.Log; import android.util.Log;
@ -62,7 +61,6 @@ public class FDroid extends FragmentActivity {
private ProgressDialog pd; private ProgressDialog pd;
private ViewPager viewPager; private ViewPager viewPager;
private AppListFragmentPageAdapter viewPageAdapter;
private AppListManager manager = null; private AppListManager manager = null;
@ -75,10 +73,6 @@ public class FDroid extends FragmentActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
if (PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean("lightTheme", false))
setTheme(R.style.AppThemeLight);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
manager = new AppListManager(this); manager = new AppListManager(this);
setContentView(R.layout.fdroid); setContentView(R.layout.fdroid);
@ -248,13 +242,8 @@ public class FDroid extends FragmentActivity {
UpdateService.schedule(getBaseContext()); UpdateService.schedule(getBaseContext());
if (data != null && data.hasExtra("update")) { if (data != null && data.hasExtra("update")) {
updateRepos(); updateRepos();
} else if (data != null && data.hasExtra("restart")) { } else {
final Intent intent = getIntent(); repopulateViews();
overridePendingTransition(0, 0);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
finish();
overridePendingTransition(0, 0);
startActivity(intent);
} }
break; break;
@ -263,7 +252,7 @@ public class FDroid extends FragmentActivity {
private void createViews() { private void createViews() {
viewPager = (ViewPager)findViewById(R.id.main_pager); viewPager = (ViewPager)findViewById(R.id.main_pager);
viewPageAdapter = new AppListFragmentPageAdapter(this); AppListFragmentPageAdapter viewPageAdapter = new AppListFragmentPageAdapter(this);
viewPager.setAdapter(viewPageAdapter); viewPager.setAdapter(viewPageAdapter);
viewPager.setOnPageChangeListener( new ViewPager.SimpleOnPageChangeListener() { viewPager.setOnPageChangeListener( new ViewPager.SimpleOnPageChangeListener() {
public void onPageSelected(int position) { public void onPageSelected(int position) {

View File

@ -77,10 +77,6 @@ public class ManageRepo extends ListActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
if (PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean("lightTheme", false))
setTheme(R.style.AppThemeLight);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.repolist); setContentView(R.layout.repolist);

View File

@ -24,7 +24,6 @@ import android.app.ActionBar;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.preference.Preference; import android.preference.Preference;
import android.preference.PreferenceManager;
import android.preference.PreferenceActivity; import android.preference.PreferenceActivity;
import android.preference.Preference.OnPreferenceClickListener; import android.preference.Preference.OnPreferenceClickListener;
import android.widget.Toast; import android.widget.Toast;
@ -33,43 +32,25 @@ import org.fdroid.fdroid.compat.ActionBarCompat;
public class PreferencesActivity extends PreferenceActivity implements public class PreferencesActivity extends PreferenceActivity implements
OnPreferenceClickListener { OnPreferenceClickListener {
private boolean ignoreTouchscreenChanged = false;
private boolean lightThemeChanged = false;
Intent ret; Intent ret;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
if (PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean("lightTheme", false))
setTheme(R.style.AppThemeLight);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ActionBarCompat.create(this).setDisplayHomeAsUpEnabled(true); ActionBarCompat.create(this).setDisplayHomeAsUpEnabled(true);
addPreferencesFromResource(R.xml.preferences); addPreferencesFromResource(R.xml.preferences);
for (String prefkey : new String[] { "ignoreTouchscreen", //for (String prefkey : new String[] { }) {
"lightTheme" }) { //Preference pref = findPreference(prefkey);
Preference pref = findPreference(prefkey); //pref.setOnPreferenceClickListener(this);
pref.setOnPreferenceClickListener(this); //}
}
ret = new Intent();
} }
@Override @Override
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
String key = preference.getKey(); // Currently no actions are returned
if (key.equals("ignoreTouchscreen")) //String key = preference.getKey();
ignoreTouchscreenChanged ^= true; //if (key.equals("...")) {
else Intent ret = new Intent();
lightThemeChanged ^= true;
if (lightThemeChanged)
ret.putExtra("restart", true);
else if (ignoreTouchscreenChanged)
ret.putExtra("update", true);
setResult(RESULT_OK, ret); setResult(RESULT_OK, ret);
return true; return true;
} }

View File

@ -52,10 +52,6 @@ public class SearchResults extends ListActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
if (PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean("lightTheme", false))
setTheme(R.style.AppThemeLight);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ActionBarCompat.create(this).setDisplayHomeAsUpEnabled(true); ActionBarCompat.create(this).setDisplayHomeAsUpEnabled(true);
applist = new AvailableAppListAdapter(this); applist = new AvailableAppListAdapter(this);