Adjust button layout
This commit is contained in:
1 parent
d01370e480
commit
fd4a535701
23 files changed
+204
-176
No files matched your search
@@ -134,27 +134,27 @@ public final class MainActivity extends StageActivity
|
||||
public void startSceneForCheckStep(int checkStep, Bundle args) {
|
||||
switch (checkStep) {
|
||||
case CHECK_STEP_SECURITY:
|
||||
if (Settings.getShowWarning()) {
|
||||
if (true || Settings.getShowWarning()) {
|
||||
startScene(new Announcer(WarningScene.class).setArgs(args));
|
||||
break;
|
||||
}
|
||||
case CHECK_STEP_WARNING:
|
||||
if (Settings.getAskAnalytics()) {
|
||||
if (true || Settings.getAskAnalytics()) {
|
||||
startScene(new Announcer(AnalyticsScene.class).setArgs(args));
|
||||
break;
|
||||
}
|
||||
case CHECK_STEP_ANALYTICS:
|
||||
if (Crash.hasCrashFile()) {
|
||||
if (true || Crash.hasCrashFile()) {
|
||||
startScene(new Announcer(CrashScene.class).setArgs(args));
|
||||
break;
|
||||
}
|
||||
case CHECK_STEP_CRASH:
|
||||
if (EhUtils.needSignedIn(this)) {
|
||||
if (true || EhUtils.needSignedIn(this)) {
|
||||
startScene(new Announcer(SignInScene.class).setArgs(args));
|
||||
break;
|
||||
}
|
||||
case CHECK_STEP_SIGN_IN:
|
||||
if (Settings.getSelectSite()) {
|
||||
if (true || Settings.getSelectSite()) {
|
||||
startScene(new Announcer(SelectSiteScene.class).setArgs(args));
|
||||
break;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ public final class MainActivity extends StageActivity
|
||||
protected Announcer getLaunchAnnouncer() {
|
||||
if (!TextUtils.isEmpty(Settings.getSecurity())) {
|
||||
return new Announcer(SecurityScene.class);
|
||||
} else if (Settings.getShowWarning()) {
|
||||
} else if (true || Settings.getShowWarning()) {
|
||||
return new Announcer(WarningScene.class);
|
||||
} else if (Settings.getAskAnalytics()) {
|
||||
return new Announcer(AnalyticsScene.class);
|
||||
|
||||
@@ -28,8 +28,6 @@ import com.hippo.ehviewer.Analytics;
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.hippo.ehviewer.Settings;
|
||||
import com.hippo.ehviewer.ui.MainActivity;
|
||||
import com.hippo.ehviewer.ui.annotation.ViewLifeCircle;
|
||||
import com.hippo.rippleold.RippleSalon;
|
||||
import com.hippo.text.Html;
|
||||
import com.hippo.text.LinkMovementMethod2;
|
||||
import com.hippo.yorozuya.ViewUtils;
|
||||
@@ -37,11 +35,9 @@ import com.hippo.yorozuya.ViewUtils;
|
||||
public class AnalyticsScene extends BaseScene implements View.OnClickListener {
|
||||
|
||||
@Nullable
|
||||
@ViewLifeCircle
|
||||
private View mCancel;
|
||||
private View mReject;
|
||||
@Nullable
|
||||
@ViewLifeCircle
|
||||
private View mOk;
|
||||
private View mAccept;
|
||||
|
||||
@Override
|
||||
public boolean needShowLeftDrawer() {
|
||||
@@ -54,18 +50,15 @@ public class AnalyticsScene extends BaseScene implements View.OnClickListener {
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.scene_analytics, container, false);
|
||||
|
||||
mCancel = ViewUtils.$$(view, R.id.cancel);
|
||||
mOk = ViewUtils.$$(view, R.id.ok);
|
||||
mReject = ViewUtils.$$(view, R.id.reject);
|
||||
mAccept = ViewUtils.$$(view, R.id.accept);
|
||||
TextView text = (TextView) ViewUtils.$$(view, R.id.text);
|
||||
|
||||
text.setText(Html.fromHtml(getString(R.string.analytics_explain)));
|
||||
text.setMovementMethod(LinkMovementMethod2.getInstance());
|
||||
|
||||
mCancel.setOnClickListener(this);
|
||||
mOk.setOnClickListener(this);
|
||||
|
||||
RippleSalon.addRipple(mCancel, true);
|
||||
RippleSalon.addRipple(mOk, true);
|
||||
mReject.setOnClickListener(this);
|
||||
mAccept.setOnClickListener(this);
|
||||
|
||||
return view;
|
||||
}
|
||||
@@ -74,8 +67,8 @@ public class AnalyticsScene extends BaseScene implements View.OnClickListener {
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
mCancel = null;
|
||||
mOk = null;
|
||||
mReject = null;
|
||||
mAccept = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,9 +78,9 @@ public class AnalyticsScene extends BaseScene implements View.OnClickListener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mCancel == v) {
|
||||
if (mReject == v) {
|
||||
Settings.putEnableAnalytics(false);
|
||||
} else if (mOk == v) {
|
||||
} else if (mAccept == v) {
|
||||
Settings.putEnableAnalytics(true);
|
||||
// Start Analytics
|
||||
Analytics.start(context);
|
||||
|
||||
@@ -41,7 +41,6 @@ import com.hippo.ehviewer.client.EhUrl;
|
||||
import com.hippo.ehviewer.client.EhUtils;
|
||||
import com.hippo.ehviewer.client.parser.ProfileParser;
|
||||
import com.hippo.ehviewer.ui.MainActivity;
|
||||
import com.hippo.rippleold.RippleSalon;
|
||||
import com.hippo.scene.Announcer;
|
||||
import com.hippo.scene.SceneFragment;
|
||||
import com.hippo.util.ExceptionUtils;
|
||||
@@ -144,9 +143,6 @@ public final class SignInScene extends BaseScene implements EditText.OnEditorAct
|
||||
mSignInViaCookies.setOnClickListener(this);
|
||||
mSkipSigningIn.setOnClickListener(this);
|
||||
|
||||
RippleSalon.addRipple(mRegister, true);
|
||||
RippleSalon.addRipple(mSignIn, true);
|
||||
|
||||
Context context = getContext2();
|
||||
AssertUtils.assertNotNull(container);
|
||||
EhApplication application = (EhApplication) context.getApplicationContext();
|
||||
|
||||
@@ -26,19 +26,15 @@ import com.hippo.ehviewer.R;
|
||||
import com.hippo.ehviewer.Settings;
|
||||
import com.hippo.ehviewer.ui.MainActivity;
|
||||
import com.hippo.ehviewer.ui.annotation.ViewLifeCircle;
|
||||
import com.hippo.rippleold.RippleSalon;
|
||||
import com.hippo.yorozuya.ViewUtils;
|
||||
|
||||
public final class WarningScene extends BaseScene implements View.OnClickListener {
|
||||
|
||||
private static final String TAG = WarningScene.class.getSimpleName();
|
||||
|
||||
@Nullable
|
||||
private View mReject;
|
||||
@Nullable
|
||||
@ViewLifeCircle
|
||||
private View mCancel;
|
||||
@Nullable
|
||||
@ViewLifeCircle
|
||||
private View mOk;
|
||||
private View mAccept;
|
||||
|
||||
@Override
|
||||
public boolean needShowLeftDrawer() {
|
||||
@@ -51,14 +47,11 @@ public final class WarningScene extends BaseScene implements View.OnClickListene
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.scene_warning, container, false);
|
||||
|
||||
mCancel = ViewUtils.$$(view, R.id.cancel);
|
||||
mOk = ViewUtils.$$(view, R.id.ok);
|
||||
mReject = ViewUtils.$$(view, R.id.reject);
|
||||
mAccept = ViewUtils.$$(view, R.id.accept);
|
||||
|
||||
mCancel.setOnClickListener(this);
|
||||
mOk.setOnClickListener(this);
|
||||
|
||||
RippleSalon.addRipple(mCancel, true);
|
||||
RippleSalon.addRipple(mOk, true);
|
||||
mReject.setOnClickListener(this);
|
||||
mAccept.setOnClickListener(this);
|
||||
|
||||
return view;
|
||||
}
|
||||
@@ -67,15 +60,15 @@ public final class WarningScene extends BaseScene implements View.OnClickListene
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
mCancel = null;
|
||||
mOk = null;
|
||||
mReject = null;
|
||||
mAccept = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mCancel == v) {
|
||||
if (mReject == v) {
|
||||
finishStage();
|
||||
} else if (mOk == v) {
|
||||
} else if (mAccept == v) {
|
||||
// Never show this warning anymore
|
||||
Settings.putShowWarning(false);
|
||||
|
||||
|
||||
Reference in new issue
Block a user