diff options
author | Andrew Dolgov <[email protected]> | 2013-06-02 23:38:15 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-06-02 23:38:15 +0400 |
commit | d957a46bd0e74b175d182544090cf28b283680b6 (patch) | |
tree | 3efbf622707643093d66f33d71b16c479a878efd /src | |
parent | 13ecf808ead927644a21b949a4189c7d0c27ea19 (diff) |
fixes for 2.3
Diffstat (limited to 'src')
-rw-r--r-- | src/org/fox/ttcomics/MainActivity.java | 62 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ViewComicActivity.java | 16 |
2 files changed, 37 insertions, 41 deletions
diff --git a/src/org/fox/ttcomics/MainActivity.java b/src/org/fox/ttcomics/MainActivity.java index 47e23bc..b859c27 100644 --- a/src/org/fox/ttcomics/MainActivity.java +++ b/src/org/fox/ttcomics/MainActivity.java @@ -98,39 +98,37 @@ public class MainActivity extends CommonActivity { m_fileName = savedInstanceState.getString("fileName"); } - if (!isCompatMode()) { - m_tabListener = new TabListener(); - - ActionBar actionBar = getSupportActionBar(); - - actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); - - actionBar.addTab(getSupportActionBar().newTab() - .setText(R.string.tab_all_comics) - .setTabListener(m_tabListener)); - - actionBar.addTab(getSupportActionBar().newTab() - .setText(R.string.tab_unread) - .setTabListener(m_tabListener)); - - actionBar.addTab(getSupportActionBar().newTab() - .setText(R.string.tab_unfinished) - .setTabListener(m_tabListener)); - - actionBar.addTab(getSupportActionBar().newTab() - .setText(R.string.tab_read) - .setTabListener(m_tabListener)); - - if (savedInstanceState != null) { - m_selectedTab = savedInstanceState.getInt("selectedTab"); - } else { - m_selectedTab = getIntent().getIntExtra("selectedTab", 0); - } - - actionBar.selectTab(actionBar.getTabAt(m_selectedTab)); - - actionBar.setDisplayHomeAsUpEnabled(m_baseDirectory.length() > 0); + m_tabListener = new TabListener(); + + ActionBar actionBar = getSupportActionBar(); + + actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); + + actionBar.addTab(getSupportActionBar().newTab() + .setText(R.string.tab_all_comics) + .setTabListener(m_tabListener)); + + actionBar.addTab(getSupportActionBar().newTab() + .setText(R.string.tab_unread) + .setTabListener(m_tabListener)); + + actionBar.addTab(getSupportActionBar().newTab() + .setText(R.string.tab_unfinished) + .setTabListener(m_tabListener)); + + actionBar.addTab(getSupportActionBar().newTab() + .setText(R.string.tab_read) + .setTabListener(m_tabListener)); + + if (savedInstanceState != null) { + m_selectedTab = savedInstanceState.getInt("selectedTab"); + } else { + m_selectedTab = getIntent().getIntExtra("selectedTab", 0); } + + actionBar.selectTab(actionBar.getTabAt(m_selectedTab)); + + actionBar.setDisplayHomeAsUpEnabled(m_baseDirectory.length() > 0); if (m_prefs.getString("comics_directory", null) == null) { AlertDialog.Builder builder = new AlertDialog.Builder(this); diff --git a/src/org/fox/ttcomics/ViewComicActivity.java b/src/org/fox/ttcomics/ViewComicActivity.java index 88774ed..e38d54d 100644 --- a/src/org/fox/ttcomics/ViewComicActivity.java +++ b/src/org/fox/ttcomics/ViewComicActivity.java @@ -1,19 +1,14 @@ package org.fox.ttcomics;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Date;
-
-import com.actionbarsherlock.view.Menu;
-import com.actionbarsherlock.view.MenuItem;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Dialog;
-import android.content.BroadcastReceiver;
-import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -21,7 +16,6 @@ import android.content.pm.ActivityInfo; import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Environment;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.LayoutInflater;
@@ -32,6 +26,9 @@ import android.widget.NumberPicker; import android.widget.SeekBar;
import android.widget.TextView;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuItem;
+
public class ViewComicActivity extends CommonActivity {
private final String TAG = this.getClass().getSimpleName();
@@ -42,11 +39,12 @@ public class ViewComicActivity extends CommonActivity { @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+
+ if (!isCompatMode())
+ setTheme(m_prefs.getBoolean("use_dark_theme", false) ? R.style.DarkTheme : R.style.AppTheme);
requestWindowFeature(Window.FEATURE_PROGRESS);
- setTheme(m_prefs.getBoolean("use_dark_theme", false) ? R.style.DarkTheme : R.style.AppTheme);
-
setContentView(R.layout.activity_view_comic);
if (savedInstanceState == null) {
|