添加 AbstractActivity
This commit is contained in:
1 parent
0d0153c6e8
commit
a2182e0f05
5 files changed
+39
-20
No files matched your search
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Hippo Seven
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.hippo.ehviewer.activity;
|
||||
|
||||
import com.hippo.ehviewer.util.Config;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
|
||||
public abstract class AbstractActivity extends Activity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
int screenOri = Config.getScreenOriMode();
|
||||
if (screenOri != getRequestedOrientation())
|
||||
setRequestedOrientation(screenOri);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -59,7 +59,7 @@ import android.widget.TextView;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.AdapterView.OnItemLongClickListener;
|
||||
|
||||
public class DownloadActivity extends Activity {
|
||||
public class DownloadActivity extends AbstractActivity {
|
||||
|
||||
private static final String TAG = "DownloadActivity";
|
||||
|
||||
@@ -388,10 +388,6 @@ public class DownloadActivity extends Activity {
|
||||
mAppContext = (AppContext)getApplication();
|
||||
mImageGeterManager = mAppContext.getImageGeterManager();
|
||||
|
||||
int screenOri = Config.getScreenOriMode();
|
||||
if (screenOri != getRequestedOrientation())
|
||||
setRequestedOrientation(screenOri);
|
||||
|
||||
Ui.translucent(this);
|
||||
|
||||
// Download service
|
||||
|
||||
@@ -52,7 +52,7 @@ import com.hippo.ehviewer.widget.AlertButton;
|
||||
import com.hippo.ehviewer.widget.DialogBuilder;
|
||||
import com.hippo.ehviewer.widget.LoadImageView;
|
||||
|
||||
public class FavouriteActivity extends Activity{
|
||||
public class FavouriteActivity extends AbstractActivity {
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = "FavouriteActivity";
|
||||
|
||||
@@ -204,10 +204,6 @@ public class FavouriteActivity extends Activity{
|
||||
mData = mAppContext.getData();
|
||||
mImageGeterManager = mAppContext.getImageGeterManager();
|
||||
|
||||
int screenOri = Config.getScreenOriMode();
|
||||
if (screenOri != getRequestedOrientation())
|
||||
setRequestedOrientation(screenOri);
|
||||
|
||||
Ui.translucent(this);
|
||||
|
||||
// Download service
|
||||
|
||||
@@ -64,7 +64,7 @@ import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class MangaActivity extends Activity {
|
||||
public class MangaActivity extends AbstractActivity {
|
||||
private String TAG = "MangaActivity";
|
||||
|
||||
private AppContext mAppContext;
|
||||
@@ -279,10 +279,6 @@ public class MangaActivity extends Activity {
|
||||
mAppContext = (AppContext)getApplication();
|
||||
mEhClient = mAppContext.getEhClient();
|
||||
|
||||
int screenOri = Config.getScreenOriMode();
|
||||
if (screenOri != getRequestedOrientation())
|
||||
setRequestedOrientation(screenOri);
|
||||
|
||||
getActionBar().hide();
|
||||
// For API < 16 Fullscreen
|
||||
if (Build.VERSION.SDK_INT < 19) {
|
||||
|
||||
@@ -55,7 +55,7 @@ import android.view.WindowManager;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class MangaDownloadActivity extends Activity {
|
||||
public class MangaDownloadActivity extends AbstractActivity {
|
||||
private static final String TAG = "MangaDownloadActivity";
|
||||
|
||||
public static final String KEY_TITLE = "title";
|
||||
@@ -72,10 +72,6 @@ public class MangaDownloadActivity extends Activity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.gl_root_group);
|
||||
|
||||
int screenOri = Config.getScreenOriMode();
|
||||
if (screenOri != getRequestedOrientation())
|
||||
setRequestedOrientation(screenOri);
|
||||
|
||||
getActionBar().hide();
|
||||
// For API < 16 Fullscreen
|
||||
if (Build.VERSION.SDK_INT < 19) {
|
||||
|
||||
Reference in new issue
Block a user