Enabled Holo theme for devices api 11+

closes #44 

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-05-13 11:33:33 -04:00
parent 370c7dacf7
commit f311ede6d3
7 changed files with 88 additions and 48 deletions

View File

@@ -36,7 +36,8 @@
<application <application
android:icon="@drawable/icon" android:icon="@drawable/icon"
android:label="@string/app_name" > android:label="@string/app_name"
android:theme="@style/Theme.Custom" >
<activity <activity
android:name="LocationRinger" android:name="LocationRinger"
android:configChanges="keyboard|orientation" android:configChanges="keyboard|orientation"
@@ -83,13 +84,11 @@
<service <service
android:name=".services.LocationService" android:name=".services.LocationService"
android:enabled="true" android:enabled="true"
android:exported="true"
android:process=":LocationService" > android:process=":LocationService" >
</service> </service>
<service <service
android:name=".services.RingerProcessingService" android:name=".services.RingerProcessingService"
android:enabled="true" android:enabled="true"
android:exported="true"
android:process=":RingerProcessingService" > android:process=":RingerProcessingService" >
</service> </service>

View File

@@ -1,44 +1,40 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:orientation="vertical" >
android:orientation="vertical">
<RelativeLayout
<RelativeLayout android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content" >
android:layout_height="wrap_content">
<ProgressBar
<ProgressBar android:id="@+id/search_progress"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/search_progress" android:layout_alignParentRight="true"
android:visibility="invisible" android:visibility="invisible" />
android:layout_alignParentRight="true"
/> <Button
android:id="@+id/ok"
<Button android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_alignParentRight="true"
android:text="@android:string/ok" android:layout_toLeftOf="@id/search_progress"
android:id="@+id/ok" android:text="@android:string/ok" />
android:layout_toLeftOf="@id/search_progress"
<EditText
/> android:id="@+id/address"
android:layout_width="fill_parent"
<EditText android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_toLeftOf="@id/ok"
android:layout_height="wrap_content" android:hint="@string/address"
android:hint="@string/address" android:inputType="textPostalAddress" />
android:id="@+id/address" </RelativeLayout>
android:layout_toLeftOf="@id/ok"
android:inputType="textPostalAddress"/> <ListView
android:id="@+id/address_list"
</RelativeLayout> android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/address_list"
/>
</LinearLayout> </LinearLayout>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Custom" parent="android:Theme.Holo"></style>
<style name="Theme.Custom.NoTitleBar" parent="android:Theme.Holo.NoActionBar"></style>
<style name="Theme.Custom.Fullscreen" parent="android:Theme.Holo.NoActionBar.Fullscreen"></style>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Custom" parent="android:Theme.DeviceDefault"></style>
<style name="Theme.Custom.NoTitleBar" parent="android:Theme.DeviceDefault.NoActionBar"></style>
<style name="Theme.Custom.Fullscreen" parent="android:Theme.DeviceDefault.NoActionBar.Fullscreen"></style>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Custom" parent="android:Theme.Black"></style>
<style name="Theme.Custom.NoTitleBar" parent="android:Theme.Black.NoTitleBar"></style>
<style name="Theme.Custom.Fullscreen" parent="android:Theme.Black.NoTitleBar.Fullscreen"></style>
</resources>

View File

@@ -46,6 +46,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
private SharedPreferences mSettings; private SharedPreferences mSettings;
private ProgressDialog mProgress; private ProgressDialog mProgress;
public static final String NO_SPLASH = "no splash";
public static final String KEY_RINGER = "key_ringer"; public static final String KEY_RINGER = "key_ringer";
public static final String KEY_INFO = "key_info"; public static final String KEY_INFO = "key_info";
public static final String KEY_IS_DEFAULT = "key_is_default"; public static final String KEY_IS_DEFAULT = "key_is_default";
@@ -130,6 +131,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.ringer_list); setContentView(R.layout.ringer_list);
this.setTitle(R.string.app_name);
this.mDb = new RingerDatabase(this, this); this.mDb = new RingerDatabase(this, this);
this.mListView = (ListView) findViewById(R.id.ringer_list); this.mListView = (ListView) findViewById(R.id.ringer_list);
this.mListView.setOnItemClickListener(this); this.mListView.setOnItemClickListener(this);
@@ -146,7 +148,8 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
new SkyHookRegistration(this).registerNewUser(this); new SkyHookRegistration(this).registerNewUser(this);
} }
this.startActivity(new Intent(this, Splash.class)); if(!this.getIntent().hasExtra(NO_SPLASH))
this.startActivity(new Intent(this, Splash.class));
} }
/** /**

View File

@@ -23,8 +23,9 @@ import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import com.TwentyCodes.android.LocationRinger.EnableScrollingListener; import com.TwentyCodes.android.LocationRinger.EnableScrollingListener;
import com.TwentyCodes.android.LocationRinger.R; import com.TwentyCodes.android.LocationRinger.LocationRinger;
import com.TwentyCodes.android.LocationRinger.OnContentChangedListener; import com.TwentyCodes.android.LocationRinger.OnContentChangedListener;
import com.TwentyCodes.android.LocationRinger.R;
import com.TwentyCodes.android.LocationRinger.db.RingerDatabase; import com.TwentyCodes.android.LocationRinger.db.RingerDatabase;
import com.TwentyCodes.android.LocationRinger.debug.Debug; import com.TwentyCodes.android.LocationRinger.debug.Debug;
import com.TwentyCodes.android.LocationRinger.ui.fragments.AboutRingerFragment; import com.TwentyCodes.android.LocationRinger.ui.fragments.AboutRingerFragment;
@@ -54,6 +55,13 @@ public class RingerInformationActivity extends FragmentActivity implements OnCon
super.onCreate(arg0); super.onCreate(arg0);
setContentView(R.layout.ringer_information_activity); setContentView(R.layout.ringer_information_activity);
/*
* Set up the action bar if required
*/
if(Integer.valueOf(android.os.Build.VERSION.SDK_INT) > 11)
getActionBar().setDisplayHomeAsUpEnabled(true);
this.mData = new Intent().putExtras(RingerInformationActivity.this.getIntent()); this.mData = new Intent().putExtras(RingerInformationActivity.this.getIntent());
this.mRinger = this.mData.getParcelableExtra(ListActivity.KEY_RINGER); this.mRinger = this.mData.getParcelableExtra(ListActivity.KEY_RINGER);
@@ -147,11 +155,15 @@ public class RingerInformationActivity extends FragmentActivity implements OnCon
* @author ricky barrette * @author ricky barrette
*/ */
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(final MenuItem item) {
switch(item.getItemId()){ switch(item.getItemId()){
case SAVE_ID: case SAVE_ID:
save(); save();
break; break;
case android.R.id.home:
final Intent intent = new Intent(this, LocationRinger.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).putExtra(ListActivity.NO_SPLASH, ListActivity.NO_SPLASH);
startActivity(intent);
return true;
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }