0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 12:02:16 +02:00

Merge pull request #4093 from hssm/themes-colors

Lint fixes and minor cleanup
This commit is contained in:
Houssam Salem 2016-02-19 18:28:29 +11:00
commit eb735b87c0
14 changed files with 38 additions and 116 deletions

View File

@ -85,13 +85,8 @@ public class Info extends AnkiActivity {
}
});
TextView termsAndConditionsView = (TextView) findViewById(R.id.info_terms_and_conditions);
termsAndConditionsView.setMovementMethod(LinkMovementMethod.getInstance());
Button continueButton = (Button) findViewById(R.id.info_continue);
continueButton.setOnClickListener(new OnClickListener() {
Button marketButton = (Button) findViewById(R.id.market);
marketButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
if (mType == TYPE_ABOUT) {
@ -148,8 +143,8 @@ public class Info extends AnkiActivity {
res.getString(R.string.link_source))).append("<br/><br/>");
sb.append("</body></html>");
webView.loadDataWithBaseURL("", sb.toString(), "text/html", "utf-8", null);
((Button) findViewById(R.id.info_continue)).setText(res.getString(R.string.info_rate));
Button debugCopy = ((Button) findViewById(R.id.info_later));
((Button) findViewById(R.id.market)).setText(res.getString(R.string.info_rate));
Button debugCopy = ((Button) findViewById(R.id.debug_info));
debugCopy.setText(res.getString(R.string.feedback_copy_debug));
debugCopy.setVisibility(View.VISIBLE);
debugCopy.setOnClickListener(new OnClickListener() {

View File

@ -88,21 +88,28 @@ public class MetaDB {
mMetaDb.execSQL("CREATE TABLE IF NOT EXISTS smallWidgetStatus (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, "
+ "due INTEGER NOT NULL, eta INTEGER NOT NULL)");
// Use pragma to get info about widgetStatus.
Cursor c = mMetaDb.rawQuery("PRAGMA table_info(widgetStatus)", null);
int columnNumber = c.getCount();
if (columnNumber > 0) {
if (columnNumber < 7) {
mMetaDb.execSQL("ALTER TABLE widgetStatus " + "ADD COLUMN eta INTEGER NOT NULL DEFAULT '0'");
mMetaDb.execSQL("ALTER TABLE widgetStatus " + "ADD COLUMN time INTEGER NOT NULL DEFAULT '0'");
Cursor c = null;
try {
c = mMetaDb.rawQuery("PRAGMA table_info(widgetStatus)", null);
int columnNumber = c.getCount();
if (columnNumber > 0) {
if (columnNumber < 7) {
mMetaDb.execSQL("ALTER TABLE widgetStatus " + "ADD COLUMN eta INTEGER NOT NULL DEFAULT '0'");
mMetaDb.execSQL("ALTER TABLE widgetStatus " + "ADD COLUMN time INTEGER NOT NULL DEFAULT '0'");
}
} else {
mMetaDb.execSQL("CREATE TABLE IF NOT EXISTS widgetStatus (" + "deckId INTEGER NOT NULL PRIMARY KEY, "
+ "deckName TEXT NOT NULL, " + "newCards INTEGER NOT NULL, " + "lrnCards INTEGER NOT NULL, "
+ "dueCards INTEGER NOT NULL, " + "progress INTEGER NOT NULL, " + "eta INTEGER NOT NULL)");
}
mMetaDb.setVersion(databaseVersion);
Timber.i("MetaDB:: Upgrading Internal Database finished. New version: %d", databaseVersion);
return mMetaDb;
} finally {
if (c != null) {
c.close();
}
} else {
mMetaDb.execSQL("CREATE TABLE IF NOT EXISTS widgetStatus (" + "deckId INTEGER NOT NULL PRIMARY KEY, "
+ "deckName TEXT NOT NULL, " + "newCards INTEGER NOT NULL, " + "lrnCards INTEGER NOT NULL, "
+ "dueCards INTEGER NOT NULL, " + "progress INTEGER NOT NULL, " + "eta INTEGER NOT NULL)");
}
mMetaDb.setVersion(databaseVersion);
Timber.i("MetaDB:: Upgrading Internal Database finished. New version: %d", databaseVersion);
return mMetaDb;
}

View File

@ -15,7 +15,7 @@
<item>
<shape android:shape="rectangle" >
<solid android:color="#000000" />
<stroke android:width=".5dp" android:color="#101010"/>
<stroke android:width="1dp" android:color="#101010"/>
</shape>
</item>
</selector>

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2010 The Android Open Source Project
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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@android:id/background"
android:drawable="@color/widget_progressbar_empty"/>
<item android:id="@android:id/progress">
<scale
android:drawable="@drawable/progress_widget_primary"
android:scaleWidth="100%" />
</item>
</layer-list>

View File

@ -1,10 +1,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layoutInLoadPronActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".LoadPronounciationActivity" >
android:orientation="vertical" >
<TextView
android:id="@+id/textViewPoweredBy"

View File

@ -1,10 +1,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/MainLayoutInImageSearchActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".SearchImageActivity" >
android:orientation="vertical" >
<WebView
android:id="@+id/ImageSearchWebView"

View File

@ -1,8 +1,6 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".AnkiStatsActivity$ChartFragment">
android:layout_height="fill_parent">
<com.ichi2.anki.stats.ChartView
android:layout_width="fill_parent"

View File

@ -30,7 +30,6 @@
<include layout="@layout/toolbar" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
@ -38,69 +37,32 @@
android:layout_weight="1"
android:fadingEdge="vertical"
android:gravity="center">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fadingEdge="vertical" >
<WebView
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical" />
<RelativeLayout
android:id="@+id/info_loading_layer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:gravity="center"
android:visibility="invisible" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/loading_shared_decks" />
</RelativeLayout>
<include layout="@layout/progress_bar" />
</FrameLayout>
<WebView
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical" />
<include layout="@layout/progress_bar" />
</RelativeLayout>
<TextView
android:id="@+id/info_terms_and_conditions"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/terms_and_conditions"
android:visibility="gone" />
<LinearLayout
android:id="@+id/info_buttons"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/info_later"
android:id="@+id/debug_info"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="@string/later"
android:visibility="gone" />
<Button
android:id="@+id/info_sync"
android:id="@+id/market"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="@string/button_sync"
android:visibility="gone" />
<Button
android:id="@+id/info_continue"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="@string/dialog_continue" />
android:text="@string/dialog_continue"/>
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>

View File

@ -93,8 +93,6 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:padding="3dp"
android:orientation="vertical"
>

View File

@ -51,7 +51,6 @@
android:fillViewport="true">
<LinearLayout
android:id="@+id/studyoptions_scrollcontainer"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_add_new_note_type"
android:title="@string/model_editor_action_add_model"

View File

@ -102,7 +102,6 @@
<string name="time_quantity_days">%d d</string>
<string name="time_quantity_months">%.1f mo</string>
<string name="time_quantity_years">%.1f yr</string><!-- or "%.1f a" -->
<string name="later">Later</string>
<string name="rebuild_cram_deck">Rebuilding cram deck…</string>
<string name="rebuild_cram_label">Rebuild</string>
<string name="empty_cram_label">Empty</string>

View File

@ -26,7 +26,6 @@
<string name="retry">Retry</string>
<string name="cancel">Cancel</string>
<string name="loading_shared_decks">Loading available shared decks…</string>
<string name="terms_and_conditions"><a href="https://ankiweb.net/account/terms">Terms and conditions</a></string>
<string name="menu_get_shared_decks">Get shared decks</string>
<string name="connection_error_message">A network error has occurred</string>

View File

@ -29,7 +29,6 @@
<color name="transparent">#00000000</color>
<color name="white">#ffffff</color>
<color name="black">#000000</color>
<color name="widget_progressbar_empty">#000000</color>
<!-- Material Design: http://www.google.com/design/spec/style/color.html#color-color-palette -->