implemented homeAsUp button
This commit is contained in:
parent
254fad8f70
commit
75e2288654
|
@ -44,6 +44,7 @@ public class DownloadActivity extends SherlockListActivity implements
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
Log.d(TAG, "Creating Activity");
|
Log.d(TAG, "Creating Activity");
|
||||||
requester = DownloadRequester.getInstance();
|
requester = DownloadRequester.getInstance();
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +105,9 @@ public class DownloadActivity extends SherlockListActivity implements
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
case MENU_SHOW_LOG:
|
case MENU_SHOW_LOG:
|
||||||
startActivity(new Intent(this, DownloadLogActivity.class));
|
startActivity(new Intent(this, DownloadLogActivity.class));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -6,30 +6,40 @@ import com.actionbarsherlock.app.SherlockListActivity;
|
||||||
import com.actionbarsherlock.view.Menu;
|
import com.actionbarsherlock.view.Menu;
|
||||||
import com.actionbarsherlock.view.MenuItem;
|
import com.actionbarsherlock.view.MenuItem;
|
||||||
|
|
||||||
import de.podfetcher.R;
|
|
||||||
import de.podfetcher.adapter.DownloadLogAdapter;
|
import de.podfetcher.adapter.DownloadLogAdapter;
|
||||||
import de.podfetcher.feed.FeedManager;
|
import de.podfetcher.feed.FeedManager;
|
||||||
|
|
||||||
public class DownloadLogActivity extends SherlockListActivity {
|
public class DownloadLogActivity extends SherlockListActivity {
|
||||||
private static final String TAG = "DownloadLogActivity";
|
private static final String TAG = "DownloadLogActivity";
|
||||||
|
|
||||||
DownloadLogAdapter dla;
|
DownloadLogAdapter dla;
|
||||||
FeedManager manager;
|
FeedManager manager;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
manager = FeedManager.getInstance();
|
manager = FeedManager.getInstance();
|
||||||
|
|
||||||
dla = new DownloadLogAdapter(this, 0, manager.getDownloadLog());
|
dla = new DownloadLogAdapter(this, 0, manager.getDownloadLog());
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
setListAdapter(dla);
|
setListAdapter(dla);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ import android.widget.ViewSwitcher;
|
||||||
import com.actionbarsherlock.app.SherlockActivity;
|
import com.actionbarsherlock.app.SherlockActivity;
|
||||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||||
import com.actionbarsherlock.view.Menu;
|
import com.actionbarsherlock.view.Menu;
|
||||||
|
import com.actionbarsherlock.view.MenuItem;
|
||||||
import com.actionbarsherlock.view.Window;
|
import com.actionbarsherlock.view.Window;
|
||||||
import com.viewpagerindicator.TabPageIndicator;
|
import com.viewpagerindicator.TabPageIndicator;
|
||||||
|
|
||||||
|
@ -124,8 +125,19 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// TODO Auto-generated method stub
|
return true;
|
||||||
return super.onCreateOptionsMenu(menu);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -172,7 +184,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements
|
||||||
orientation = getResources().getConfiguration().orientation;
|
orientation = getResources().getConfiguration().orientation;
|
||||||
manager = FeedManager.getInstance();
|
manager = FeedManager.getInstance();
|
||||||
getWindow().setFormat(PixelFormat.TRANSPARENT);
|
getWindow().setFormat(PixelFormat.TRANSPARENT);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
bindToService();
|
bindToService();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -665,8 +677,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements
|
||||||
holderCreated = false;
|
holderCreated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MediaPlayerPagerAdapter extends
|
public static class MediaPlayerPagerAdapter extends FragmentPagerAdapter {
|
||||||
FragmentPagerAdapter {
|
|
||||||
private int numItems;
|
private int numItems;
|
||||||
private MediaplayerActivity activity;
|
private MediaplayerActivity activity;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ package de.podfetcher.activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import com.actionbarsherlock.app.SherlockPreferenceActivity;
|
import com.actionbarsherlock.app.SherlockPreferenceActivity;
|
||||||
|
import com.actionbarsherlock.view.Menu;
|
||||||
|
import com.actionbarsherlock.view.MenuItem;
|
||||||
|
|
||||||
import de.podfetcher.R;
|
import de.podfetcher.R;
|
||||||
|
|
||||||
|
@ -10,6 +12,25 @@ public class PreferenceActivity extends SherlockPreferenceActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
addPreferencesFromResource(R.xml.preferences);
|
addPreferencesFromResource(R.xml.preferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue