移除错误的提示
This commit is contained in:
1 parent
e01ef1abff
commit
deefd9b9e3
5 files changed
+17
-77
No files matched your search
@@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2014 Hippo Seven
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/mode"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12.0dp"
|
||||
android:layout_marginBottom="12.0dp"
|
||||
android:entries="@array/mode_list" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/warning"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12.0dp"
|
||||
android:textColor="@android:color/holo_red_dark"
|
||||
android:text="@string/select_mode_warning"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -186,7 +186,7 @@
|
||||
<string name="popular_display_settings_title">热门</string>
|
||||
<string name="show_popular_update_time_title">显示热门更新时间</string>
|
||||
|
||||
<string name="eh_settings_title">EH 设置(需要登录)</string>
|
||||
<string name="eh_settings_title">EH</string>
|
||||
<string name="detail_eh_settings_title">详情</string>
|
||||
<string name="preview_mode_title">预览图模式</string>
|
||||
<string name="preview_mode_normal">正常预览图</string>
|
||||
|
||||
@@ -25,9 +25,7 @@
|
||||
<string-array name="mode_list" translatable="false">
|
||||
<item>g.e-hentai.org</item>
|
||||
<item>exhentai.org</item>
|
||||
<item>lofi.e-hentai.org (460x)</item>
|
||||
<item>lofi.e-hentai.org (780x)</item>
|
||||
<item>lofi.e-hentai.org (980x)</item>
|
||||
<item>lofi.e-hentai.org</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="comment_long_click">
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
<string name="popular_display_settings_title">Popular</string>
|
||||
<string name="show_popular_update_time_title">Show popular update time</string>
|
||||
|
||||
<string name="eh_settings_title">EH (login required)</string>
|
||||
<string name="eh_settings_title">EH</string>
|
||||
<string name="detail_eh_settings_title">Detail</string>
|
||||
<string name="preview_mode_title">Preview mode</string>
|
||||
<string name="preview_mode_normal">Normal</string>
|
||||
|
||||
@@ -65,6 +65,7 @@ import android.graphics.drawable.Drawable;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ImageSpan;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@@ -73,6 +74,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.AdapterView.OnItemLongClickListener;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Button;
|
||||
@@ -239,36 +241,19 @@ public class MangaListActivity extends AbstractGalleryActivity
|
||||
}).create();
|
||||
}
|
||||
|
||||
private void checkModeWarning(int mode, View warning) {
|
||||
if (mode == 1 && !mEhClient.isLogin())
|
||||
warning.setVisibility(View.VISIBLE);
|
||||
else
|
||||
warning.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private AlertDialog createModeDialog() {
|
||||
LayoutInflater inflater = this.getLayoutInflater();
|
||||
final View view = inflater.inflate(R.layout.mode, null);
|
||||
final TextView warning = (TextView)view.findViewById(R.id.warning);
|
||||
final Spinner modeSpinner = (Spinner)view.findViewById(R.id.mode);
|
||||
int mode = Config.getMode();
|
||||
modeSpinner.setSelection(mode);
|
||||
checkModeWarning(mode, warning);
|
||||
modeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
checkModeWarning(position, warning);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
warning.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
final Spinner modeSpinner = new Spinner(this);
|
||||
modeSpinner.setAdapter(new ArrayAdapter<CharSequence>(this,
|
||||
android.R.layout.simple_spinner_dropdown_item,
|
||||
this.getResources().getTextArray(R.array.mode_list)));
|
||||
modeSpinner.setSelection(Config.getMode());
|
||||
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
lp.gravity = Gravity.CENTER;
|
||||
lp.topMargin = Ui.dp2pix(12);
|
||||
lp.bottomMargin = Ui.dp2pix(12);
|
||||
return new DialogBuilder(this).setTitle(R.string.mode)
|
||||
.setView(view, true)
|
||||
.setView(modeSpinner, lp)
|
||||
.setPositiveButton(android.R.string.ok, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -280,12 +265,7 @@ public class MangaListActivity extends AbstractGalleryActivity
|
||||
Config.setMode(mode);
|
||||
}
|
||||
}
|
||||
}).setNegativeButton(android.R.string.cancel, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
((AlertButton)v).dialog.dismiss();
|
||||
}
|
||||
}).create();
|
||||
}).setSimpleNegativeButton().create();
|
||||
}
|
||||
|
||||
private void handleSearchView(View view) {
|
||||
|
||||
Reference in new issue
Block a user