diff options
author | Andrew Dolgov <[email protected]> | 2014-10-15 12:26:16 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2014-10-15 12:26:16 +0400 |
commit | a2e8246a4e087e6394eb20860aa10dec77b071ab (patch) | |
tree | 708aaf28ac74ca7b39a3a0585080d7a931840436 /src | |
parent | 4384b802c88293568fa72e128b3b03725c6631cb (diff) |
update support library
switch to actionbarcompat/themecompat stuff from actionbarsherlock
Diffstat (limited to 'src')
-rw-r--r-- | src/org/fox/ttcomics/ComicFragment.java | 6 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ComicPager.java | 9 | ||||
-rw-r--r-- | src/org/fox/ttcomics/CommonActivity.java | 7 | ||||
-rw-r--r-- | src/org/fox/ttcomics/MainActivity.java | 13 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ViewComicActivity.java | 12 |
5 files changed, 22 insertions, 25 deletions
diff --git a/src/org/fox/ttcomics/ComicFragment.java b/src/org/fox/ttcomics/ComicFragment.java index 1523726..75d750f 100644 --- a/src/org/fox/ttcomics/ComicFragment.java +++ b/src/org/fox/ttcomics/ComicFragment.java @@ -5,8 +5,6 @@ import it.sephiroth.android.library.imagezoom.ImageViewTouch; import java.io.IOException;
-import com.actionbarsherlock.app.ActionBar;
-
import android.app.Activity;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
@@ -15,6 +13,7 @@ import android.os.AsyncTask; import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
+import android.support.v7.app.ActionBar;
import android.util.Log;
import android.view.GestureDetector;
import android.view.LayoutInflater;
@@ -70,8 +69,7 @@ public class ComicFragment extends Fragment implements GestureDetector.OnDoubleT }
}
- public ComicFragment(int page) {
- super();
+ public void setPage(int page) {
m_page = page;
}
diff --git a/src/org/fox/ttcomics/ComicPager.java b/src/org/fox/ttcomics/ComicPager.java index 260194c..4371df4 100644 --- a/src/org/fox/ttcomics/ComicPager.java +++ b/src/org/fox/ttcomics/ComicPager.java @@ -32,7 +32,10 @@ public class ComicPager extends Fragment { @Override
public Fragment getItem(int position) {
- return new ComicFragment(position);
+ ComicFragment cf = new ComicFragment();
+ cf.setPage(position);
+
+ return cf;
}
@Override
@@ -81,9 +84,7 @@ public class ComicPager extends Fragment { }
}
- public ComicPager(String fileName) {
- super();
-
+ public void setFileName(String fileName) {
m_fileName = fileName;
}
diff --git a/src/org/fox/ttcomics/CommonActivity.java b/src/org/fox/ttcomics/CommonActivity.java index 9892ef5..ef3cdc4 100644 --- a/src/org/fox/ttcomics/CommonActivity.java +++ b/src/org/fox/ttcomics/CommonActivity.java @@ -24,16 +24,15 @@ import android.os.Bundle; import android.os.Environment;
import android.preference.PreferenceManager;
import android.provider.BaseColumns;
+import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Display;
+import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.Toast;
-import com.actionbarsherlock.app.SherlockFragmentActivity;
-import com.actionbarsherlock.view.MenuItem;
-
-public class CommonActivity extends SherlockFragmentActivity {
+public class CommonActivity extends ActionBarActivity {
private final String TAG = this.getClass().getSimpleName();
protected static final String FRAG_COMICS_PAGER = "comic_pager";
diff --git a/src/org/fox/ttcomics/MainActivity.java b/src/org/fox/ttcomics/MainActivity.java index c4db1c7..cf2f798 100644 --- a/src/org/fox/ttcomics/MainActivity.java +++ b/src/org/fox/ttcomics/MainActivity.java @@ -5,13 +5,6 @@ import java.io.File; import java.lang.reflect.Field; import java.lang.reflect.Method; -import com.actionbarsherlock.app.ActionBar.Tab; -import com.actionbarsherlock.app.ActionBar; -import com.actionbarsherlock.internal.app.ActionBarImpl; -import com.actionbarsherlock.internal.app.ActionBarWrapper; -import com.actionbarsherlock.view.Menu; -import com.actionbarsherlock.view.MenuItem; - import android.animation.LayoutTransition; import android.annotation.SuppressLint; import android.app.AlertDialog; @@ -20,7 +13,11 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; +import android.support.v7.app.ActionBar; +import android.support.v7.app.ActionBar.Tab; import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; import android.view.ViewGroup; import android.view.Window; import android.widget.ShareActionProvider; @@ -166,7 +163,7 @@ public class MainActivity extends CommonActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { - getSupportMenuInflater().inflate(R.menu.activity_main, menu); + getMenuInflater().inflate(R.menu.activity_main, menu); boolean isDonationFound = getPackageManager().checkSignatures( getPackageName(), "org.fox.ttcomics.donation") == PackageManager.SIGNATURE_MATCH; diff --git a/src/org/fox/ttcomics/ViewComicActivity.java b/src/org/fox/ttcomics/ViewComicActivity.java index 9a9ce89..0c3630b 100644 --- a/src/org/fox/ttcomics/ViewComicActivity.java +++ b/src/org/fox/ttcomics/ViewComicActivity.java @@ -21,6 +21,8 @@ import android.os.Bundle; import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
@@ -28,9 +30,6 @@ 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();
@@ -52,8 +51,11 @@ public class ViewComicActivity extends CommonActivity { if (savedInstanceState == null) {
m_fileName = getIntent().getStringExtra("fileName");
+ ComicPager cp = new ComicPager();
+ cp.setFileName(m_fileName);
+
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
- ft.replace(R.id.comics_pager_container, new ComicPager(m_fileName), FRAG_COMICS_PAGER);
+ ft.replace(R.id.comics_pager_container, cp, FRAG_COMICS_PAGER);
ft.commit();
} else {
m_fileName = savedInstanceState.getString("fileName");
@@ -80,7 +82,7 @@ public class ViewComicActivity extends CommonActivity { @Override
public boolean onCreateOptionsMenu(Menu menu) {
- getSupportMenuInflater().inflate(R.menu.activity_view_comic, menu);
+ getMenuInflater().inflate(R.menu.activity_view_comic, menu);
menu.findItem(R.id.menu_sync_location).setVisible(m_prefs.getBoolean("use_position_sync", false) && m_syncClient.hasOwner());
|