Adding some items to the navigation drawer as well as a floating button in the main activity
This commit is contained in:
parent
0f9fa1d166
commit
62f86341cb
5
.idea/assetWizardSettings.xml
generated
5
.idea/assetWizardSettings.xml
generated
@ -18,7 +18,7 @@
|
||||
<PersistentState>
|
||||
<option name="values">
|
||||
<map>
|
||||
<entry key="url" value="jar:file:/Applications/Android%20Studio.app/Contents/plugins/android/lib/android.jar!/images/material_design_icons/navigation/ic_menu_black_24dp.xml" />
|
||||
<entry key="url" value="jar:file:/Applications/Android%20Studio.app/Contents/plugins/android/lib/android.jar!/images/material_design_icons/content/ic_add_black_24dp.xml" />
|
||||
</map>
|
||||
</option>
|
||||
</PersistentState>
|
||||
@ -28,7 +28,8 @@
|
||||
</option>
|
||||
<option name="values">
|
||||
<map>
|
||||
<entry key="outputName" value="ic_menu_black_24dp" />
|
||||
<entry key="color" value="ffffff" />
|
||||
<entry key="outputName" value="ic_add_white" />
|
||||
<entry key="sourceFile" value="$USER_HOME$" />
|
||||
</map>
|
||||
</option>
|
||||
|
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -45,12 +45,12 @@ public class LocalFeedRepository extends ARepository implements QueryCallback {
|
||||
@Override
|
||||
public void sync() {
|
||||
executor.execute(() -> {
|
||||
RSSNetwork request = new RSSNetwork();
|
||||
RSSNetwork rssNet = new RSSNetwork();
|
||||
List<Feed> feedList = database.feedDao().getAllFeeds();
|
||||
|
||||
for (Feed feed : feedList) {
|
||||
try {
|
||||
request.request(feed.getUrl(), this);
|
||||
rssNet.request(feed.getUrl(), this);
|
||||
} catch (Exception e) {
|
||||
failureCallBackInMainThread(e);
|
||||
}
|
||||
@ -71,7 +71,9 @@ public class LocalFeedRepository extends ARepository implements QueryCallback {
|
||||
|
||||
@Override
|
||||
public void deleteFeed(Item item) {
|
||||
executor.execute(() -> {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
9
app/src/main/res/drawable/ic_about.xml
Normal file
9
app/src/main/res/drawable/ic_about.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="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_add.xml
Normal file
9
app/src/main/res/drawable/ic_add.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>
|
5
app/src/main/res/drawable/ic_add_white.xml
Normal file
5
app/src/main/res/drawable/ic_add_white.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_folder.xml
Normal file
9
app/src/main/res/drawable/ic_folder.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="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_settings.xml
Normal file
9
app/src/main/res/drawable/ic_settings.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.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
|
||||
</vector>
|
@ -34,9 +34,22 @@
|
||||
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_add_white"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/nav_view"
|
||||
|
@ -1,15 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:showIn="navigation_view">
|
||||
|
||||
<group android:id="@+id/first_group">
|
||||
<item
|
||||
android:id="@+id/non_read_articles"
|
||||
android:title="@string/non_read_articles"
|
||||
android:icon="@drawable/ic_rss_feed"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/to_read"
|
||||
android:title="@string/to_read"
|
||||
android:icon="@drawable/ic_read_later"/>
|
||||
</group>
|
||||
|
||||
<group android:id="@+id/second_group">
|
||||
<item
|
||||
android:id="@+id/add_feed_item"
|
||||
android:title="@string/add_feed_item"
|
||||
android:icon="@drawable/ic_add"/>
|
||||
<item
|
||||
android:id="@+id/add_folder_item"
|
||||
android:title="@string/add_folder_item"
|
||||
android:icon="@drawable/ic_folder"/>
|
||||
</group>
|
||||
|
||||
<group
|
||||
android:id="@+id/third_group">
|
||||
<item
|
||||
android:id="@+id/settings_item"
|
||||
android:title="@string/settings"
|
||||
android:icon="@drawable/ic_settings"/>
|
||||
<item
|
||||
android:id="@+id/about_item"
|
||||
android:title="@string/about_item"
|
||||
android:icon="@drawable/ic_about"/>
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
<item
|
||||
android:id="@+id/non_read_articles"
|
||||
android:title="@string/non_read_articles"
|
||||
android:icon="@drawable/ic_rss_feed"
|
||||
/>
|
||||
|
||||
<item
|
||||
android:id="@+id/to_read"
|
||||
android:title="@string/to_read"
|
||||
android:icon="@drawable/ic_read_later"/>
|
||||
|
||||
</menu>
|
@ -1,9 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Readrops</string>
|
||||
<string name="to_read">A lire</string>
|
||||
<string name="non_read_articles">Articles non lus</string>
|
||||
<string name="open_nav_drawer">Ouvrir le menu</string>
|
||||
<string name="close_nav_drawer">Fermer le menu</string>
|
||||
<string name="add_feed_item">Ajouter un flux</string>
|
||||
<string name="add_folder_item">Ajouter un dossier</string>
|
||||
<string name="settings">Paramètres</string>
|
||||
<string name="about_item">A propos</string>
|
||||
|
||||
</resources>
|
@ -5,4 +5,8 @@
|
||||
<string name="non_read_articles">Non read articles</string>
|
||||
<string name="open_nav_drawer">Open menu</string>
|
||||
<string name="close_nav_drawer">Close menu</string>
|
||||
<string name="add_feed_item">Add feed</string>
|
||||
<string name="add_folder_item">Add folder</string>
|
||||
<string name="settings">Settings</string>
|
||||
<string name="about_item">About</string>
|
||||
</resources>
|
||||
|
@ -21,7 +21,7 @@ import okhttp3.Response;
|
||||
|
||||
public class RSSNetwork {
|
||||
|
||||
public static final String TAG = RSSNetwork.class.getName();
|
||||
public static final String TAG = RSSNetwork.class.getSimpleName();
|
||||
|
||||
/**
|
||||
* Request the url given in parameter.
|
||||
@ -33,7 +33,6 @@ public class RSSNetwork {
|
||||
public void request(String url, final QueryCallback callback) throws Exception {
|
||||
OkHttpClient okHttpClient = new OkHttpClient();
|
||||
|
||||
Log.d(TAG, "starting request");
|
||||
Request request = new Request.Builder().url(url).build();
|
||||
Response response = okHttpClient.newCall(request).execute();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user