Skip to content

Commit

Permalink
修复未激活时点击设置闪退
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunflash committed May 20, 2024
1 parent 0452ecc commit 8c34403
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import androidx.appcompat.app.AppCompatActivity;

import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.snackbar.Snackbar;
import com.gyf.immersionbar.ImmersionBar;

public class MainActivity extends AppCompatActivity {
Expand Down Expand Up @@ -59,8 +60,14 @@ protected void onCreate(Bundle savedInstanceState) {
}

public void toSettingActivity(View view) {
if(MainActivity.isModuleActive()){
Intent intent = new Intent(MainActivity.this, SettingActivity.class);
startActivity(intent);
}
else{
Snackbar.make(view, R.string.open_module, Snackbar.LENGTH_SHORT)
.show();
}
}

public void toAboutActivity() {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-night/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
<string name="酷安">酷安@xunflash</string>
<string name="Githubid">Github@Xunflash</string>
<string name="xunflash">Xunflash</string>
<string name="open_module">请先激活模块</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
<string name="attachment_summary_on">Automatically download attachments for incoming emails
</string>
<string name="attachment_summary_off">Only download attachments when manually requested</string>
<string name="open_module">请先激活模块</string>
</resources>

0 comments on commit 8c34403

Please sign in to comment.