Skip to content

Commit

Permalink
Comic sources add more options
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleydu committed Aug 9, 2020
1 parent bed93f3 commit 622afbd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
builder.setTitle(getArguments().getInt(DialogCaller.EXTRA_DIALOG_TITLE))
.setView(getlistview)
.setPositiveButton(R.string.dialog_positive, this)
.setNeutralButton(R.string.comic_inverseSelection,this);
.setNeutralButton(R.string.comic_inverse_selection,this);
return builder.create();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
mSourceAdapter.notifyDataSetChanged();
break;
case R.id.comic_allSelection:
for (int i = 0; i < mSourceAdapter.getItemCount(); i++) {
Source source = mSourceAdapter.getItem(i);
source.setEnable(true);
mPresenter.update(source);
}
mSourceAdapter.notifyDataSetChanged();
break;
case R.id.comic_AllDeselect:
for (int i = 0; i < mSourceAdapter.getItemCount(); i++) {
Source source = mSourceAdapter.getItem(i);
source.setEnable(false);
mPresenter.update(source);
}
mSourceAdapter.notifyDataSetChanged();
break;
}
return super.onOptionsItemSelected(item);
}
Expand Down
13 changes: 10 additions & 3 deletions app/src/main/res/menu/menu_source.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/comic_inverseSelection"
android:title="@string/comic_inverseSelection"
android:icon="@drawable/ic_sync_white_24dp"
app:showAsAction="ifRoom" />
android:title="@string/comic_inverse_selection"
app:showAsAction="never" />
<item
android:id="@+id/comic_allSelection"
android:title="@string/comic_all_selection"
app:showAsAction="never" />
<item
android:id="@+id/comic_AllDeselect"
android:title="@string/comic_all_deselect"
app:showAsAction="never" />
</menu>
4 changes: 3 additions & 1 deletion app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
<string name="comic_load_tag_fail">讀取標籤失敗</string>
<string name="comic_status_continue">連載</string>
<string name="comic_status_finish">完結</string>
<string name="comic_inverseSelection">反選</string>
<string name="comic_inverse_selection">反選</string>
<string name="comic_all_selection">全選</string>
<string name="comic_all_deselect">全不選</string>
<string name="comic_tag_select">標籤選擇</string>
<string name="comic_info">漫畫資訊</string>
<string name="comic_info_not_found">找不到漫畫資訊</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
<string name="comic_load_tag_fail">读取标签失败</string>
<string name="comic_status_continue">连载</string>
<string name="comic_status_finish">完结</string>
<string name="comic_inverseSelection">反选</string>
<string name="comic_inverse_selection">反选</string>
<string name="comic_all_selection">全选</string>
<string name="comic_all_deselect">全不选</string>
<string name="comic_tag_select">标签选择</string>
<string name="comic_info">漫画信息</string>
<string name="comic_info_not_found">找不到漫画信息</string>
Expand Down

0 comments on commit 622afbd

Please sign in to comment.