Skip to content

Commit 8e14bce

Browse files
committed
removed share complete msgbox; cache bug fix
1 parent 7a34e06 commit 8e14bce

File tree

5 files changed

+17
-26
lines changed

5 files changed

+17
-26
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ android {
2626

2727
dependencies {
2828
implementation fileTree(dir: 'libs', include: ['*.jar'])
29-
implementation 'androidx.appcompat:appcompat:1.3.0'
29+
implementation 'androidx.appcompat:appcompat:1.4.1'
3030
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
3131
implementation 'com.google.android.material:material:1.4.0'
3232
testImplementation 'junit:junit:4.13.2'
3333
androidTestImplementation 'androidx.test:runner:1.4.0'
3434
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
3535
implementation 'com.android.support:design:31'
3636
implementation 'com.android.support:support-v4:31'
37-
implementation 'androidx.browser:browser:1.3.0'
37+
implementation 'androidx.browser:browser:1.4.0'
3838
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
3939
}

app/src/main/java/com/macindex/macindex/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,14 @@ protected void onCreate(final Bundle savedInstanceState) {
113113
} else {
114114
Log.w("MacIndex", "Database already initialized.");
115115
}
116-
initInterface(true);
117116

118117
// Cache clear if new version is registered
119118
if (PrefsHelper.registerNewVersion(this)) {
120119
clearCache();
121120
}
122121

122+
initInterface(true);
123+
123124
// Deep Link Support, Activity Not Present
124125
Uri deepLink = getIntent().getData();
125126
if (deepLink != null) {

app/src/main/java/com/macindex/macindex/SpecsActivity.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ private void shareDialog() {
12151215
ClipboardManager clipboard = (ClipboardManager) SpecsActivity.this.getSystemService(Context.CLIPBOARD_SERVICE);
12161216
ClipData clip = ClipData.newPlainText("MacIndexModelInfo", modelInfo);
12171217
clipboard.setPrimaryClip(clip);
1218-
finishShareDialog(shareEntries, shareDescription, which);
1218+
Toast.makeText(SpecsActivity.this, shareDescription[which], Toast.LENGTH_LONG).show();
12191219
} else if (which == 2) {
12201220
// User choose info
12211221
// Construct the dialog view.
@@ -1275,7 +1275,7 @@ private void shareDialog() {
12751275
ClipboardManager clipboard = (ClipboardManager) SpecsActivity.this.getSystemService(Context.CLIPBOARD_SERVICE);
12761276
ClipData clip = ClipData.newPlainText("MacIndexModelInfo", modelInfo);
12771277
clipboard.setPrimaryClip(clip);
1278-
finishShareDialog(shareEntries, shareDescription, which);
1278+
Toast.makeText(SpecsActivity.this, shareDescription[which], Toast.LENGTH_LONG).show();
12791279
selectDialogCreated.dismiss();
12801280
} else {
12811281
Toast.makeText(SpecsActivity.this, R.string.share_menu_null, Toast.LENGTH_LONG).show();
@@ -1290,7 +1290,7 @@ private void shareDialog() {
12901290
ClipboardManager clipboard = (ClipboardManager) SpecsActivity.this.getSystemService(Context.CLIPBOARD_SERVICE);
12911291
ClipData clip = ClipData.newPlainText("MacIndexShareLink", shareLink);
12921292
clipboard.setPrimaryClip(clip);
1293-
finishShareDialog(shareEntries, shareDescription, which);
1293+
Toast.makeText(SpecsActivity.this, shareDescription[which], Toast.LENGTH_LONG).show();
12941294
}
12951295
} catch (Exception e) {
12961296
ExceptionHelper.handleException(this, e, "shareDialog", "Unable to create the share dialog.");
@@ -1394,16 +1394,6 @@ private String generateShareInfo(final List<Integer> entries) {
13941394
return modelInfo.trim(); // Get rid of the last new line
13951395
}
13961396

1397-
private void finishShareDialog(final String[] shareEntries, final String[] shareDescription, final int which) {
1398-
AlertDialog.Builder finishShareDialog = new AlertDialog.Builder(SpecsActivity.this);
1399-
finishShareDialog.setTitle(shareEntries[which]);
1400-
finishShareDialog.setMessage(shareDescription[which]);
1401-
finishShareDialog.setPositiveButton(R.string.link_confirm, (dialogInterface, i) -> {
1402-
// intentionally left blank
1403-
});
1404-
finishShareDialog.show();
1405-
}
1406-
14071397
private void navPrev() {
14081398
machineIDPosition--;
14091399
refresh();

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,13 @@
197197
<item>生成 MacIndex 分享链接</item>
198198
</string-array>
199199
<string-array name="share_description">
200-
<item>可用的型号信息均已复制。\n该信息也可用于主页功能菜单处(“打开分享的机型”)。请参阅帮助内容。</item>
201-
<item>所有可用的信息均已复制。\n该信息也可用于主页功能菜单处(“打开分享的机型”)。请参阅帮助内容。</item>
202-
<item>已选择的信息均已复制。\n该信息也可用于主页功能菜单处(“打开分享的机型”)。请参阅帮助内容。</item>
203-
<item>分享链接已复制,MacIndex 可以直接打开该链接。\n该链接也可用于主页功能菜单处(“打开分享的机型”)。请参阅帮助内容。</item>
200+
<item>可用的型号信息均已复制</item>
201+
<item>所有可用的信息均已复制</item>
202+
<item>已选择的信息均已复制</item>
203+
<item>分享链接已复制</item>
204204
</string-array>
205205
<string name="share_menu_null">请选择至少一项来继续</string>
206206
<string name="share_menu_not_applicable">(无信息)</string>
207-
<string name="share_main_decode">要直接浏览某机型的详细参数,在此粘贴下列受支持的信息(请参阅帮助内容):\nMacIndex 中的正式机型名称\n由 MacIndex 分享功能复制的信息\n由 MacIndex 生成的分享链接</string>
207+
<string name="share_main_decode">要直接浏览某机型的详细参数,在此粘贴下列受支持的信息(请参阅帮助内容):\n• MacIndex 中的正式机型名称\n• 由 MacIndex 分享功能复制的信息\n• 由 MacIndex 生成的分享链接</string>
208208
<string name="share_main_decode_failed">无法读取该信息,或该机型在这个版本中不存在</string>
209209
</resources>

app/src/main/res/values/strings.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,13 @@
217217
<item>Generate MacIndex Share Link</item>
218218
</string-array>
219219
<string-array name="share_description">
220-
<item>Available model information copied.\nThis information could also be used in the Main Submenu ("Open Shared Model").</item>
221-
<item>All available information copied.\nThis information could also be used in the Main Submenu ("Open Shared Model").</item>
222-
<item>Selected information entries copied.\nThis information could also be used in the Main Submenu ("Open Shared Model").</item>
223-
<item>Share link generated. MacIndex can recognize this link.\nThis link could also be used in the Main Submenu ("Open Shared Model").</item>
220+
<item>Available model information copied</item>
221+
<item>All available information copied</item>
222+
<item>Selected information entries copied</item>
223+
<item>Share link generated</item>
224224
</string-array>
225225
<string name="share_menu_null">Select at least one entry to continue</string>
226226
<string name="share_menu_not_applicable">(No Info)</string>
227-
<string name="share_main_decode">To open the corresponding specification page directly, paste one of the following supported information:\nMachine name in MacIndex\nSharing information copied from MacIndex\nMacIndex share link generated by MacIndex</string>
227+
<string name="share_main_decode">To open the corresponding specification page directly, paste one of the following supported information:\n• Machine name in MacIndex\n• Any sharing information copied from MacIndex\n• MacIndex share link generated by MacIndex</string>
228228
<string name="share_main_decode_failed">Cannot read the information, or this model does not exist in current version</string>
229229
</resources>

0 commit comments

Comments
 (0)