Add custom fab

This commit is contained in:
Shinokuni 2019-02-22 14:42:56 +00:00
parent 9e13b3aca0
commit e543fa3664
10 changed files with 45 additions and 8 deletions

View File

@ -18,7 +18,7 @@
<PersistentState> <PersistentState>
<option name="values"> <option name="values">
<map> <map>
<entry key="url" value="jar:file:/Applications/Android%20Studio.app/Contents/plugins/android/lib/android.jar!/images/material_design_icons/social/ic_share_black_24dp.xml" /> <entry key="url" value="jar:file:/Applications/Android%20Studio.app/Contents/plugins/android/lib/android.jar!/images/material_design_icons/file/ic_folder_black_24dp.xml" />
</map> </map>
</option> </option>
</PersistentState> </PersistentState>
@ -29,7 +29,7 @@
<option name="values"> <option name="values">
<map> <map>
<entry key="color" value="ffffff" /> <entry key="color" value="ffffff" />
<entry key="outputName" value="ic_share_white" /> <entry key="outputName" value="ic_folder_white" />
<entry key="sourceFile" value="$USER_HOME$" /> <entry key="sourceFile" value="$USER_HOME$" />
</map> </map>
</option> </option>

Binary file not shown.

View File

@ -59,5 +59,5 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0' implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'com.github.clans:fab:1.6.4'
} }

View File

@ -212,6 +212,10 @@ public class MainActivity extends AppCompatActivity implements SimpleCallback, S
dialog.show(); dialog.show();
} }
public void addFolder(View view) {
}
public void insertNewFeed(ParsingResult result) { public void insertNewFeed(ParsingResult result) {
refreshLayout.setRefreshing(true); refreshLayout.setRefreshing(true);
viewModel.addFeed(result); viewModel.addFeed(result);

View 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="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>

View 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="M3.9,12c0,-1.71 1.39,-3.1 3.1,-3.1h4L11,7L7,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5h4v-1.9L7,15.1c-1.71,0 -3.1,-1.39 -3.1,-3.1zM8,13h8v-2L8,11v2zM17,7h-4v1.9h4c1.71,0 3.1,1.39 3.1,3.1s-1.39,3.1 -3.1,3.1h-4L13,17h4c2.76,0 5,-2.24 5,-5s-2.24,-5 -5,-5z"/>
</vector>

View File

@ -46,14 +46,35 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton <com.github.clans.fab.FloatingActionMenu
android:id="@+id/add_action_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:layout_margin="16dp" android:layout_margin="12dp"
android:onClick="displayAddFeedDialog" app:menu_colorNormal="@color/colorPrimary"
android:src="@drawable/ic_add_white" /> app:menu_icon="@drawable/fab_add">
<com.github.clans.fab.FloatingActionButton
android:id="@+id/add_feed_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="displayAddFeedDialog"
android:src="@drawable/ic_insert_link_white"
app:fab_colorNormal="@color/colorPrimary"
app:fab_label="@string/add_feed_item"
app:fab_size="mini" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/add_folder_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="addFolder"
android:src="@drawable/ic_folder_white"
app:fab_colorNormal="@color/colorPrimary"
app:fab_label="@string/add_folder"
app:fab_size="mini" />
</com.github.clans.fab.FloatingActionMenu>
</FrameLayout> </FrameLayout>

View File

@ -22,5 +22,6 @@
<string name="read_time_one_minute">1 min</string> <string name="read_time_one_minute">1 min</string>
<string name="share">Partager l\'article</string> <string name="share">Partager l\'article</string>
<string name="open_url">Ouvrir le lien</string> <string name="open_url">Ouvrir le lien</string>
<string name="add_folder">Ajouter un dossier</string>
</resources> </resources>

View File

@ -24,4 +24,5 @@
<string name="interpoint" translatable="false">·</string> <string name="interpoint" translatable="false">·</string>
<string name="share">Share Article</string> <string name="share">Share Article</string>
<string name="open_url">Open url</string> <string name="open_url">Open url</string>
<string name="add_folder">Add folder</string>
</resources> </resources>