Merge branch 'develop' into feature/macgills/#1386-use-fetch-downloads
# Conflicts: # app/src/main/res/layout/download_item.xml
@ -166,8 +166,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
public static boolean refresh;
|
||||
public static boolean wifiOnly;
|
||||
public static boolean nightMode;
|
||||
private static Uri KIWIX_LOCAL_MARKET_URI;
|
||||
private static Uri KIWIX_BROWSER_MARKET_URI;
|
||||
private final ArrayList<String> bookmarks = new ArrayList<>();
|
||||
private final List<KiwixWebView> webViewList = new ArrayList<>();
|
||||
@BindView(R.id.activity_main_root)
|
||||
@ -353,7 +351,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
|
||||
checkForRateDialog();
|
||||
|
||||
initPlayStoreUri();
|
||||
isHideToolbar = sharedPreferenceUtil.getPrefHideToolbar();
|
||||
|
||||
addFileReader();
|
||||
@ -593,12 +590,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
drawerLayout.openDrawer(GravityCompat.END);
|
||||
}
|
||||
|
||||
private void initPlayStoreUri() {
|
||||
KIWIX_LOCAL_MARKET_URI = Uri.parse("market://details?id=" + getPackageName());
|
||||
KIWIX_BROWSER_MARKET_URI =
|
||||
Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName());
|
||||
}
|
||||
|
||||
private void checkForRateDialog() {
|
||||
isFirstRun = sharedPreferenceUtil.getPrefIsFirstRun();
|
||||
visitCounterPref = new RateAppCounter(this);
|
||||
@ -650,8 +641,12 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
}
|
||||
|
||||
private void goToRateApp() {
|
||||
Uri kiwixLocalMarketUri = Uri.parse("market://details?id=" + getPackageName());
|
||||
Uri kiwixBrowserMarketUri =
|
||||
Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName());
|
||||
|
||||
Intent goToMarket = new Intent(Intent.ACTION_VIEW, KIWIX_LOCAL_MARKET_URI);
|
||||
|
||||
Intent goToMarket = new Intent(Intent.ACTION_VIEW, kiwixLocalMarketUri);
|
||||
|
||||
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
|
||||
Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET |
|
||||
@ -661,7 +656,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
startActivity(goToMarket);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW,
|
||||
KIWIX_BROWSER_MARKET_URI));
|
||||
kiwixBrowserMarketUri));
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 102 B |
Before Width: | Height: | Size: 91 B |
Before Width: | Height: | Size: 81 B |
Before Width: | Height: | Size: 82 B |
Before Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 99 B |
Before Width: | Height: | Size: 556 B |
Before Width: | Height: | Size: 853 B |
Before Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 109 B |
Before Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 112 B |
9
app/src/main/res/drawable/ic_action_back.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_action_delete.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_action_forward.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_action_plus.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_pause_black_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_stop_black_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M6,6h12v12H6z"/>
|
||||
</vector>
|
@ -1,63 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/get_content_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/content_main_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
android:id="@+id/content_main_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/content_main_card_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="144dp"
|
||||
android:contentDescription="@string/kiwi"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_home_kiwix_banner"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
android:id="@+id/content_main_card_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="144dp"
|
||||
android:contentDescription="@string/kiwi"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_home_kiwix_banner"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- constraintRight_toRightOf is used as android:layoutDirection is supported from API 17 -->
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/content_main_card_download_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/activity_horizontal_margin"
|
||||
android:text="@string/download_books"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="#1565c0"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
android:id="@+id/content_main_card_download_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/activity_horizontal_margin"
|
||||
android:text="@string/download_books"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="#1565c0"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/content_main_card"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/content_main_card" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -88,7 +89,7 @@
|
||||
android:layout_weight="0.5"
|
||||
android:minWidth="@dimen/stop_min_width"
|
||||
android:minHeight="@dimen/stop_min_height"
|
||||
android:src="@drawable/ic_stop_black_24dp"
|
||||
android:text="@string/download_stop" />
|
||||
android:text="@string/download_stop"
|
||||
app:srcCompat="@drawable/ic_stop_black_24dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|