|
@@ -1,73 +1,64 @@
|
|
-package com.sikey.skcontact.activity;
|
|
|
|
-
|
|
|
|
-import android.app.Activity;
|
|
|
|
-import android.os.Bundle;
|
|
|
|
-import android.util.Log;
|
|
|
|
-import android.view.View;
|
|
|
|
-import android.view.Window;
|
|
|
|
-import android.view.WindowManager;
|
|
|
|
-import android.widget.Toast;
|
|
|
|
-import androidx.annotation.Nullable;
|
|
|
|
-import com.sikey.skcontact.utils.Macros;
|
|
|
|
-
|
|
|
|
-public class BaseActivity extends Activity {
|
|
|
|
- public String TAG = "losion / skcontact :" + getClass().getSimpleName();
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
|
- super.onCreate(savedInstanceState);
|
|
|
|
- Log.d(TAG, "onCreate: ");
|
|
|
|
-
|
|
|
|
- if (Macros.DEBUG_FULLSCREEN) {
|
|
|
|
- setFullView();
|
|
|
|
- setHardKey();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- onCreateBase();
|
|
|
|
- initDataBase();
|
|
|
|
- initViewBase();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- protected void onStart() {
|
|
|
|
- super.onStart();
|
|
|
|
- onStartBase();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- protected void onDestroy() {
|
|
|
|
- super.onDestroy();
|
|
|
|
- onDestroyBase();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- protected void onCreateBase() { }
|
|
|
|
- protected void onStartBase() { }
|
|
|
|
- protected void initDataBase() { }
|
|
|
|
- protected void initViewBase() { }
|
|
|
|
- protected void onDestroyBase() { }
|
|
|
|
-
|
|
|
|
- private void setFullView() {
|
|
|
|
- this.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
|
|
|
- this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void setHardKey() {
|
|
|
|
- View decorView = getWindow().getDecorView();
|
|
|
|
- int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
|
|
- | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN;
|
|
|
|
- decorView.setSystemUiVisibility(uiOptions);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void changeStatusBar(boolean isShow) {
|
|
|
|
- if (isShow) {
|
|
|
|
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
|
|
- } else {
|
|
|
|
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void toast(String content) {
|
|
|
|
- Toast t = Toast.makeText(this, content, Toast.LENGTH_SHORT);
|
|
|
|
- t.show();
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+package com.sikey.skcontact.activity;
|
|
|
|
+
|
|
|
|
+import android.app.Activity;
|
|
|
|
+import android.os.Bundle;
|
|
|
|
+import android.view.View;
|
|
|
|
+import android.view.Window;
|
|
|
|
+import android.view.WindowManager;
|
|
|
|
+import android.widget.TextView;
|
|
|
|
+import android.widget.Toast;
|
|
|
|
+
|
|
|
|
+import com.sikey.skcontact.R;
|
|
|
|
+import com.sikey.skcontact.model.BaseModel;
|
|
|
|
+import com.sikey.skcontact.utils.Constant;
|
|
|
|
+import com.sikey.skcontact.utils.Macros;
|
|
|
|
+import com.sikey.skcontact.utils.ResUtils;
|
|
|
|
+import com.sikey.skcontact.adapter.BaseListAdapter;
|
|
|
|
+
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+public class BaseActivity extends Activity {
|
|
|
|
+ public String TAG = "losion / xpsettings :" + getClass().getSimpleName();
|
|
|
|
+ public TextView title;
|
|
|
|
+ public BaseListAdapter mAdapter = null;
|
|
|
|
+ public List<BaseModel> mDataList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
+ super.onCreate(savedInstanceState);
|
|
|
|
+
|
|
|
|
+ ResUtils.initResUtils(this, Constant.PACKAGE_NAME);
|
|
|
|
+
|
|
|
|
+ if (Macros.DEBUG_FULLSCREEN) {
|
|
|
|
+ setFullView();
|
|
|
|
+ setHardKey();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ void setWatchTitle(String titleStr) {
|
|
|
|
+ title = findViewById(R.id.title);
|
|
|
|
+ if (title != null) {
|
|
|
|
+ title.setText(titleStr);
|
|
|
|
+ title.setVisibility(View.VISIBLE);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void setFullView() {
|
|
|
|
+ this.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
|
|
|
+ this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void setHardKey() {
|
|
|
|
+ View decorView = getWindow().getDecorView();
|
|
|
|
+ int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
|
|
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN;
|
|
|
|
+ decorView.setSystemUiVisibility(uiOptions);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void toast(String content) {
|
|
|
|
+ Toast t = Toast.makeText(this, content, Toast.LENGTH_SHORT);
|
|
|
|
+ t.show();
|
|
|
|
+ }
|
|
|
|
+}
|