mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Merge pull request #11318 from t895/expanded-fab
Android: Use expanding Extended FAB
This commit is contained in:
commit
2aa25c03df
@ -76,6 +76,17 @@ public final class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
// Set up the FAB.
|
// Set up the FAB.
|
||||||
mBinding.buttonAddDirectory.setOnClickListener(view -> mPresenter.onFabClick());
|
mBinding.buttonAddDirectory.setOnClickListener(view -> mPresenter.onFabClick());
|
||||||
|
mBinding.appbarMain.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||||
|
{
|
||||||
|
if (verticalOffset == 0)
|
||||||
|
{
|
||||||
|
mBinding.buttonAddDirectory.extend();
|
||||||
|
}
|
||||||
|
else if (appBarLayout.getTotalScrollRange() == -verticalOffset)
|
||||||
|
{
|
||||||
|
mBinding.buttonAddDirectory.shrink();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
mPresenter.onCreate();
|
mPresenter.onCreate();
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import androidx.viewpager.widget.ViewPager;
|
|||||||
|
|
||||||
import com.google.android.material.appbar.AppBarLayout;
|
import com.google.android.material.appbar.AppBarLayout;
|
||||||
import com.google.android.material.color.MaterialColors;
|
import com.google.android.material.color.MaterialColors;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||||
|
|
||||||
import org.dolphinemu.dolphinemu.R;
|
import org.dolphinemu.dolphinemu.R;
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ public class InsetsHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setUpMainLayout(AppCompatActivity activity, AppBarLayout appBarLayout,
|
public static void setUpMainLayout(AppCompatActivity activity, AppBarLayout appBarLayout,
|
||||||
FloatingActionButton fab, ViewPager viewPager, View workaroundView)
|
ExtendedFloatingActionButton fab, ViewPager viewPager, View workaroundView)
|
||||||
{
|
{
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(appBarLayout, (v, windowInsets) ->
|
ViewCompat.setOnApplyWindowInsetsListener(appBarLayout, (v, windowInsets) ->
|
||||||
{
|
{
|
||||||
|
@ -50,11 +50,12 @@
|
|||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:background="@android:color/transparent" />
|
android:background="@android:color/transparent" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||||
android:id="@+id/button_add_directory"
|
android:id="@+id/button_add_directory"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_add"
|
android:text="@string/add_games"
|
||||||
|
app:icon="@drawable/ic_add"
|
||||||
app:layout_anchor="@+id/pager_platforms"
|
app:layout_anchor="@+id/pager_platforms"
|
||||||
app:layout_anchorGravity="bottom|right|end" />
|
app:layout_anchorGravity="bottom|right|end" />
|
||||||
|
|
||||||
|
@ -440,6 +440,7 @@
|
|||||||
<string name="platform_gamecube">GameCube Games</string>
|
<string name="platform_gamecube">GameCube Games</string>
|
||||||
<string name="platform_wii">Wii Games</string>
|
<string name="platform_wii">Wii Games</string>
|
||||||
<string name="platform_wiiware">WiiWare Games</string>
|
<string name="platform_wiiware">WiiWare Games</string>
|
||||||
|
<string name="add_games">Add Games</string>
|
||||||
<string name="add_directory_title">Add Folder to Library</string>
|
<string name="add_directory_title">Add Folder to Library</string>
|
||||||
<string name="grid_menu_settings">Settings</string>
|
<string name="grid_menu_settings">Settings</string>
|
||||||
<string name="grid_menu_refresh">Refresh Library</string>
|
<string name="grid_menu_refresh">Refresh Library</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user