Skip to content

Commit

Permalink
集成表情功能到评论页面
Browse files Browse the repository at this point in the history
  • Loading branch information
CeuiLiSA committed Jun 23, 2020
1 parent f1c6b59 commit af31fc9
Show file tree
Hide file tree
Showing 9 changed files with 411 additions and 331 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "ceui.lisa.pixiv"
minSdkVersion 21
targetSdkVersion 28
versionCode 95
versionName "1.9.5"
versionCode 96
versionName "1.9.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
16 changes: 8 additions & 8 deletions app/src/main/java/ceui/lisa/activities/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mContext = this;
mActivity = this;

Intent intent = getIntent();
if (intent != null) {
Bundle bundle = intent.getExtras();
if (bundle != null) {
initBundle(bundle);
}
}

if (hideStatusBar()) {
getWindow().setStatusBarColor(Color.TRANSPARENT);
getWindow().getDecorView().setSystemUiVisibility(
Expand All @@ -45,14 +53,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
baseBind = DataBindingUtil.setContentView(mActivity, mLayoutID);
BarUtils.setNavBarColor(mActivity, getResources().getColor(R.color.trans));

Intent intent = getIntent();
if (intent != null) {
Bundle bundle = intent.getExtras();
if (bundle != null) {
initBundle(bundle);
}
}


initView();
initData();
Expand Down
19 changes: 15 additions & 4 deletions app/src/main/java/ceui/lisa/activities/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.blankj.utilcode.util.RomUtils;
import com.bumptech.glide.Glide;
import com.google.android.material.navigation.NavigationView;
import com.tbruyelle.rxpermissions2.RxPermissions;

import java.io.File;

Expand All @@ -49,6 +50,7 @@
import ceui.lisa.utils.Params;
import ceui.lisa.utils.ReverseImage;
import ceui.lisa.utils.ReverseWebviewCallback;
import io.reactivex.disposables.Disposable;

import static ceui.lisa.activities.Shaft.sUserModel;

Expand Down Expand Up @@ -114,11 +116,20 @@ public int getCount() {

@Override
protected void initData() {
Common.showLog(className + DeviceUtils.getSDKVersionName());
Common.showLog(className + DeviceUtils.getModel());
Common.showLog(className + DeviceUtils.getManufacturer());
if (sUserModel != null && sUserModel.getResponse().getUser().isIs_login()) {
initFragment();
final RxPermissions rxPermissions = new RxPermissions(mActivity);
Disposable disposable = rxPermissions
.requestEachCombined(
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
.subscribe(permission -> {
if (permission.granted) {
initFragment();
} else {
Common.showToast(mActivity.getString(R.string.access_denied));
finish();
}
});
} else {
Intent intent = new Intent(mContext, TemplateActivity.class);
intent.putExtra(TemplateActivity.EXTRA_FRAGMENT, "登录注册");
Expand Down
18 changes: 15 additions & 3 deletions app/src/main/java/ceui/lisa/activities/TemplateActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ceui.lisa.activities;

import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.view.WindowManager;
Expand Down Expand Up @@ -59,6 +60,7 @@
import ceui.lisa.fragments.FragmentWhoFollowThisUser;
import ceui.lisa.models.IllustsBean;
import ceui.lisa.models.NovelBean;
import ceui.lisa.utils.Common;
import ceui.lisa.utils.Dev;
import ceui.lisa.utils.Params;
import ceui.lisa.utils.ReverseResult;
Expand All @@ -68,11 +70,15 @@ public class TemplateActivity extends BaseActivity<ActivityFragmentBinding> {
public static final String EXTRA_FRAGMENT = "dataType";
public static final String EXTRA_KEYWORD = "keyword";
protected Fragment childFragment;
private String dataType;

@Override
protected void initBundle(Bundle bundle) {
dataType = bundle.getString(EXTRA_FRAGMENT);
}

protected Fragment createNewFragment() {
Intent intent = getIntent();
String dataType = intent.getStringExtra(EXTRA_FRAGMENT);

if (dataType != null) {
switch (dataType) {
case "登录注册":
Expand Down Expand Up @@ -239,6 +245,12 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten

@Override
public boolean hideStatusBar() {
return getIntent().getBooleanExtra("hideStatusBar", true);
if ("相关评论".equals(dataType) || "关于软件".equals(dataType)) {
Common.showLog(className + "不隐藏状态栏");
return false;
} else {
Common.showLog(className + "隐藏状态栏");
return getIntent().getBooleanExtra("hideStatusBar", true);
}
}
}
Loading

0 comments on commit af31fc9

Please sign in to comment.