Allow songbar to appear and disappear

develop
LEdoian 3 years ago
parent f3767ca541
commit ed42e693a9

@ -43,6 +43,10 @@ namespace QuickPlay
var toolbar = FindViewById<Toolbar>(Resource.Id.toolbar); var toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
SetSupportActionBar(toolbar); SetSupportActionBar(toolbar);
SupportActionBar.Title = "My Toolbar"; SupportActionBar.Title = "My Toolbar";
// Hide the play bar by default
var bar = FindViewById(Resource.Id.currentSongBar);
bar.Visibility = ViewStates.Invisible;
} }
public override bool OnCreateOptionsMenu(IMenu menu) public override bool OnCreateOptionsMenu(IMenu menu)
@ -54,9 +58,18 @@ namespace QuickPlay
public override bool OnOptionsItemSelected(IMenuItem item) public override bool OnOptionsItemSelected(IMenuItem item)
{ {
if (item.ItemId == Resource.Id.action_settings) if (item.ItemId == Resource.Id.action_settings)
Toast.MakeText(this, "Here would be settings, when someone creates it", Android.Widget.ToastLength.Short).Show(); {
// Show the play bar
var bar = FindViewById(Resource.Id.currentSongBar);
bar.Visibility = ViewStates.Visible;
}
if (item.ItemId == Resource.Id.action_edit) if (item.ItemId == Resource.Id.action_edit)
Android.Support.Design.Widget.Snackbar.Make(FindViewById(Resource.Id.commonTopBar), "No editing this time", 10000).Show(); {
// Hide the play bar
var bar = FindViewById(Resource.Id.currentSongBar);
bar.Visibility = ViewStates.Invisible;
}
return base.OnOptionsItemSelected(item); return base.OnOptionsItemSelected(item);
} }

@ -82,9 +82,6 @@
<AndroidResource Include="Resources\layout\activity_main.xml"> <AndroidResource Include="Resources\layout\activity_main.xml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</AndroidResource> </AndroidResource>
<AndroidResource Include="Resources\layout\content_main.xml">
<SubType>Designer</SubType>
</AndroidResource>
<AndroidResource Include="Resources\values\colors.xml" /> <AndroidResource Include="Resources\values\colors.xml" />
<AndroidResource Include="Resources\values\dimens.xml" /> <AndroidResource Include="Resources\values\dimens.xml" />
<AndroidResource Include="Resources\values\ic_launcher_background.xml" /> <AndroidResource Include="Resources\values\ic_launcher_background.xml" />

@ -3082,20 +3082,20 @@ namespace QuickPlay
// aapt resource value: 0x7f090069 // aapt resource value: 0x7f090069
public const int action_bar_title = 2131296361; public const int action_bar_title = 2131296361;
// aapt resource value: 0x7f0900b0 // aapt resource value: 0x7f0900b3
public const int action_container = 2131296432; public const int action_container = 2131296435;
// aapt resource value: 0x7f09008e // aapt resource value: 0x7f09008e
public const int action_context_bar = 2131296398; public const int action_context_bar = 2131296398;
// aapt resource value: 0x7f0900bb // aapt resource value: 0x7f0900be
public const int action_divider = 2131296443; public const int action_divider = 2131296446;
// aapt resource value: 0x7f0900c1 // aapt resource value: 0x7f0900c4
public const int action_edit = 2131296449; public const int action_edit = 2131296452;
// aapt resource value: 0x7f0900b1 // aapt resource value: 0x7f0900b4
public const int action_image = 2131296433; public const int action_image = 2131296436;
// aapt resource value: 0x7f090003 // aapt resource value: 0x7f090003
public const int action_menu_divider = 2131296259; public const int action_menu_divider = 2131296259;
@ -3112,14 +3112,14 @@ namespace QuickPlay
// aapt resource value: 0x7f09006b // aapt resource value: 0x7f09006b
public const int action_mode_close_button = 2131296363; public const int action_mode_close_button = 2131296363;
// aapt resource value: 0x7f0900c0 // aapt resource value: 0x7f0900c3
public const int action_settings = 2131296448; public const int action_settings = 2131296451;
// aapt resource value: 0x7f0900b2 // aapt resource value: 0x7f0900b5
public const int action_text = 2131296434; public const int action_text = 2131296437;
// aapt resource value: 0x7f0900bc // aapt resource value: 0x7f0900bf
public const int actions = 2131296444; public const int actions = 2131296447;
// aapt resource value: 0x7f09006c // aapt resource value: 0x7f09006c
public const int activity_chooser_view_content = 2131296364; public const int activity_chooser_view_content = 2131296364;
@ -3136,8 +3136,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09003f // aapt resource value: 0x7f09003f
public const int always = 2131296319; public const int always = 2131296319;
// aapt resource value: 0x7f0900a2 // aapt resource value: 0x7f0900a5
public const int appTitleText = 2131296418; public const int appTitleText = 2131296421;
// aapt resource value: 0x7f090065 // aapt resource value: 0x7f090065
public const int async = 2131296357; public const int async = 2131296357;
@ -3169,8 +3169,8 @@ namespace QuickPlay
// aapt resource value: 0x7f090086 // aapt resource value: 0x7f090086
public const int checkbox = 2131296390; public const int checkbox = 2131296390;
// aapt resource value: 0x7f0900ba // aapt resource value: 0x7f0900bd
public const int chronometer = 2131296442; public const int chronometer = 2131296445;
// aapt resource value: 0x7f090061 // aapt resource value: 0x7f090061
public const int clip_horizontal = 2131296353; public const int clip_horizontal = 2131296353;
@ -3184,8 +3184,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09009d // aapt resource value: 0x7f09009d
public const int commonTopBar = 2131296413; public const int commonTopBar = 2131296413;
// aapt resource value: 0x7f0900a6 // aapt resource value: 0x7f0900a9
public const int container = 2131296422; public const int container = 2131296425;
// aapt resource value: 0x7f090082 // aapt resource value: 0x7f090082
public const int content = 2131296386; public const int content = 2131296386;
@ -3193,8 +3193,20 @@ namespace QuickPlay
// aapt resource value: 0x7f090075 // aapt resource value: 0x7f090075
public const int contentPanel = 2131296373; public const int contentPanel = 2131296373;
// aapt resource value: 0x7f0900a7 // aapt resource value: 0x7f0900aa
public const int coordinator = 2131296423; public const int coordinator = 2131296426;
// aapt resource value: 0x7f0900a2
public const int currentSong = 2131296418;
// aapt resource value: 0x7f09009f
public const int currentSongBar = 2131296415;
// aapt resource value: 0x7f0900a0
public const int currentSongInteractButton = 2131296416;
// aapt resource value: 0x7f0900a1
public const int currentSongProgress = 2131296417;
// aapt resource value: 0x7f09007c // aapt resource value: 0x7f09007c
public const int custom = 2131296380; public const int custom = 2131296380;
@ -3208,20 +3220,20 @@ namespace QuickPlay
// aapt resource value: 0x7f09006f // aapt resource value: 0x7f09006f
public const int default_activity_button = 2131296367; public const int default_activity_button = 2131296367;
// aapt resource value: 0x7f0900a9 // aapt resource value: 0x7f0900ac
public const int design_bottom_sheet = 2131296425; public const int design_bottom_sheet = 2131296428;
// aapt resource value: 0x7f0900ae // aapt resource value: 0x7f0900b1
public const int design_menu_item_action_area = 2131296430; public const int design_menu_item_action_area = 2131296433;
// aapt resource value: 0x7f0900ad // aapt resource value: 0x7f0900b0
public const int design_menu_item_action_area_stub = 2131296429; public const int design_menu_item_action_area_stub = 2131296432;
// aapt resource value: 0x7f0900ac // aapt resource value: 0x7f0900af
public const int design_menu_item_text = 2131296428; public const int design_menu_item_text = 2131296431;
// aapt resource value: 0x7f0900ab // aapt resource value: 0x7f0900ae
public const int design_navigation_view = 2131296427; public const int design_navigation_view = 2131296430;
// aapt resource value: 0x7f090027 // aapt resource value: 0x7f090027
public const int disableHome = 2131296295; public const int disableHome = 2131296295;
@ -3280,8 +3292,8 @@ namespace QuickPlay
// aapt resource value: 0x7f090071 // aapt resource value: 0x7f090071
public const int icon = 2131296369; public const int icon = 2131296369;
// aapt resource value: 0x7f0900bd // aapt resource value: 0x7f0900c0
public const int icon_group = 2131296445; public const int icon_group = 2131296448;
// aapt resource value: 0x7f090041 // aapt resource value: 0x7f090041
public const int ifRoom = 2131296321; public const int ifRoom = 2131296321;
@ -3289,8 +3301,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09006e // aapt resource value: 0x7f09006e
public const int image = 2131296366; public const int image = 2131296366;
// aapt resource value: 0x7f0900b6 // aapt resource value: 0x7f0900b9
public const int info = 2131296438; public const int info = 2131296441;
// aapt resource value: 0x7f090068 // aapt resource value: 0x7f090068
public const int italic = 2131296360; public const int italic = 2131296360;
@ -3301,8 +3313,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09004e // aapt resource value: 0x7f09004e
public const int labeled = 2131296334; public const int labeled = 2131296334;
// aapt resource value: 0x7f0900a5 // aapt resource value: 0x7f0900a8
public const int largeLabel = 2131296421; public const int largeLabel = 2131296424;
// aapt resource value: 0x7f090054 // aapt resource value: 0x7f090054
public const int left = 2131296340; public const int left = 2131296340;
@ -3319,8 +3331,8 @@ namespace QuickPlay
// aapt resource value: 0x7f090070 // aapt resource value: 0x7f090070
public const int list_item = 2131296368; public const int list_item = 2131296368;
// aapt resource value: 0x7f0900bf // aapt resource value: 0x7f0900c2
public const int masked = 2131296447; public const int masked = 2131296450;
// aapt resource value: 0x7f09009c // aapt resource value: 0x7f09009c
public const int message = 2131296412; public const int message = 2131296412;
@ -3340,8 +3352,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09002f // aapt resource value: 0x7f09002f
public const int multiply = 2131296303; public const int multiply = 2131296303;
// aapt resource value: 0x7f0900aa // aapt resource value: 0x7f0900ad
public const int navigation_header_container = 2131296426; public const int navigation_header_container = 2131296429;
// aapt resource value: 0x7f090042 // aapt resource value: 0x7f090042
public const int never = 2131296322; public const int never = 2131296322;
@ -3352,14 +3364,14 @@ namespace QuickPlay
// aapt resource value: 0x7f090025 // aapt resource value: 0x7f090025
public const int normal = 2131296293; public const int normal = 2131296293;
// aapt resource value: 0x7f0900b8 // aapt resource value: 0x7f0900bb
public const int notification_background = 2131296440; public const int notification_background = 2131296443;
// aapt resource value: 0x7f0900b4 // aapt resource value: 0x7f0900b7
public const int notification_main_column = 2131296436; public const int notification_main_column = 2131296439;
// aapt resource value: 0x7f0900b3 // aapt resource value: 0x7f0900b6
public const int notification_main_column_container = 2131296435; public const int notification_main_column_container = 2131296438;
// aapt resource value: 0x7f090060 // aapt resource value: 0x7f090060
public const int outline = 2131296352; public const int outline = 2131296352;
@ -3376,11 +3388,8 @@ namespace QuickPlay
// aapt resource value: 0x7f090058 // aapt resource value: 0x7f090058
public const int pin = 2131296344; public const int pin = 2131296344;
// aapt resource value: 0x7f0900a3 // aapt resource value: 0x7f0900a6
public const int playerNameText = 2131296419; public const int playerNameText = 2131296422;
// aapt resource value: 0x7f09009f
public const int progressBar1 = 2131296415;
// aapt resource value: 0x7f090006 // aapt resource value: 0x7f090006
public const int progress_circular = 2131296262; public const int progress_circular = 2131296262;
@ -3397,11 +3406,11 @@ namespace QuickPlay
// aapt resource value: 0x7f090055 // aapt resource value: 0x7f090055
public const int right = 2131296341; public const int right = 2131296341;
// aapt resource value: 0x7f0900b7 // aapt resource value: 0x7f0900ba
public const int right_icon = 2131296439; public const int right_icon = 2131296442;
// aapt resource value: 0x7f0900b5 // aapt resource value: 0x7f0900b8
public const int right_side = 2131296437; public const int right_side = 2131296440;
// aapt resource value: 0x7f09000c // aapt resource value: 0x7f09000c
public const int save_image_matrix = 2131296268; public const int save_image_matrix = 2131296268;
@ -3478,8 +3487,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09002c // aapt resource value: 0x7f09002c
public const int showTitle = 2131296300; public const int showTitle = 2131296300;
// aapt resource value: 0x7f0900a4 // aapt resource value: 0x7f0900a7
public const int smallLabel = 2131296420; public const int smallLabel = 2131296423;
// aapt resource value: 0x7f090016 // aapt resource value: 0x7f090016
public const int snackbar_action = 2131296278; public const int snackbar_action = 2131296278;
@ -3547,8 +3556,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09005a // aapt resource value: 0x7f09005a
public const int textStart = 2131296346; public const int textStart = 2131296346;
// aapt resource value: 0x7f0900af // aapt resource value: 0x7f0900b2
public const int text_input_password_toggle = 2131296431; public const int text_input_password_toggle = 2131296434;
// aapt resource value: 0x7f090018 // aapt resource value: 0x7f090018
public const int textinput_counter = 2131296280; public const int textinput_counter = 2131296280;
@ -3559,8 +3568,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09001a // aapt resource value: 0x7f09001a
public const int textinput_helper_text = 2131296282; public const int textinput_helper_text = 2131296282;
// aapt resource value: 0x7f0900b9 // aapt resource value: 0x7f0900bc
public const int time = 2131296441; public const int time = 2131296444;
// aapt resource value: 0x7f090023 // aapt resource value: 0x7f090023
public const int title = 2131296291; public const int title = 2131296291;
@ -3568,14 +3577,14 @@ namespace QuickPlay
// aapt resource value: 0x7f090080 // aapt resource value: 0x7f090080
public const int titleDividerNoCustom = 2131296384; public const int titleDividerNoCustom = 2131296384;
// aapt resource value: 0x7f0900a1 // aapt resource value: 0x7f0900a4
public const int titleText = 2131296417; public const int titleText = 2131296420;
// aapt resource value: 0x7f09007e // aapt resource value: 0x7f09007e
public const int title_template = 2131296382; public const int title_template = 2131296382;
// aapt resource value: 0x7f0900a0 // aapt resource value: 0x7f0900a3
public const int toolbar = 2131296416; public const int toolbar = 2131296419;
// aapt resource value: 0x7f090045 // aapt resource value: 0x7f090045
public const int top = 2131296325; public const int top = 2131296325;
@ -3583,8 +3592,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09007d // aapt resource value: 0x7f09007d
public const int topPanel = 2131296381; public const int topPanel = 2131296381;
// aapt resource value: 0x7f0900a8 // aapt resource value: 0x7f0900ab
public const int touch_outside = 2131296424; public const int touch_outside = 2131296427;
// aapt resource value: 0x7f09000f // aapt resource value: 0x7f09000f
public const int transition_current_scene = 2131296271; public const int transition_current_scene = 2131296271;
@ -3616,8 +3625,8 @@ namespace QuickPlay
// aapt resource value: 0x7f09001b // aapt resource value: 0x7f09001b
public const int view_offset_helper = 2131296283; public const int view_offset_helper = 2131296283;
// aapt resource value: 0x7f0900be // aapt resource value: 0x7f0900c1
public const int visible = 2131296446; public const int visible = 2131296449;
// aapt resource value: 0x7f090043 // aapt resource value: 0x7f090043
public const int withText = 2131296323; public const int withText = 2131296323;
@ -3812,85 +3821,82 @@ namespace QuickPlay
public const int commonTopBar = 2130968605; public const int commonTopBar = 2130968605;
// aapt resource value: 0x7f04001e // aapt resource value: 0x7f04001e
public const int content_main = 2130968606; public const int design_bottom_navigation_item = 2130968606;
// aapt resource value: 0x7f04001f // aapt resource value: 0x7f04001f
public const int design_bottom_navigation_item = 2130968607; public const int design_bottom_sheet_dialog = 2130968607;
// aapt resource value: 0x7f040020 // aapt resource value: 0x7f040020
public const int design_bottom_sheet_dialog = 2130968608; public const int design_layout_snackbar = 2130968608;
// aapt resource value: 0x7f040021 // aapt resource value: 0x7f040021
public const int design_layout_snackbar = 2130968609; public const int design_layout_snackbar_include = 2130968609;
// aapt resource value: 0x7f040022 // aapt resource value: 0x7f040022
public const int design_layout_snackbar_include = 2130968610; public const int design_layout_tab_icon = 2130968610;
// aapt resource value: 0x7f040023 // aapt resource value: 0x7f040023
public const int design_layout_tab_icon = 2130968611; public const int design_layout_tab_text = 2130968611;
// aapt resource value: 0x7f040024 // aapt resource value: 0x7f040024
public const int design_layout_tab_text = 2130968612; public const int design_menu_item_action_area = 2130968612;
// aapt resource value: 0x7f040025 // aapt resource value: 0x7f040025
public const int design_menu_item_action_area = 2130968613; public const int design_navigation_item = 2130968613;
// aapt resource value: 0x7f040026 // aapt resource value: 0x7f040026
public const int design_navigation_item = 2130968614; public const int design_navigation_item_header = 2130968614;
// aapt resource value: 0x7f040027 // aapt resource value: 0x7f040027
public const int design_navigation_item_header = 2130968615; public const int design_navigation_item_separator = 2130968615;
// aapt resource value: 0x7f040028 // aapt resource value: 0x7f040028
public const int design_navigation_item_separator = 2130968616; public const int design_navigation_item_subheader = 2130968616;
// aapt resource value: 0x7f040029 // aapt resource value: 0x7f040029
public const int design_navigation_item_subheader = 2130968617; public const int design_navigation_menu = 2130968617;
// aapt resource value: 0x7f04002a // aapt resource value: 0x7f04002a
public const int design_navigation_menu = 2130968618; public const int design_navigation_menu_item = 2130968618;
// aapt resource value: 0x7f04002b // aapt resource value: 0x7f04002b
public const int design_navigation_menu_item = 2130968619; public const int design_text_input_password_icon = 2130968619;
// aapt resource value: 0x7f04002c // aapt resource value: 0x7f04002c
public const int design_text_input_password_icon = 2130968620; public const int mtrl_layout_snackbar = 2130968620;
// aapt resource value: 0x7f04002d // aapt resource value: 0x7f04002d
public const int mtrl_layout_snackbar = 2130968621; public const int mtrl_layout_snackbar_include = 2130968621;
// aapt resource value: 0x7f04002e // aapt resource value: 0x7f04002e
public const int mtrl_layout_snackbar_include = 2130968622; public const int notification_action = 2130968622;
// aapt resource value: 0x7f04002f // aapt resource value: 0x7f04002f
public const int notification_action = 2130968623; public const int notification_action_tombstone = 2130968623;
// aapt resource value: 0x7f040030 // aapt resource value: 0x7f040030
public const int notification_action_tombstone = 2130968624; public const int notification_template_custom_big = 2130968624;
// aapt resource value: 0x7f040031 // aapt resource value: 0x7f040031
public const int notification_template_custom_big = 2130968625; public const int notification_template_icon_group = 2130968625;
// aapt resource value: 0x7f040032 // aapt resource value: 0x7f040032
public const int notification_template_icon_group = 2130968626; public const int notification_template_part_chronometer = 2130968626;
// aapt resource value: 0x7f040033 // aapt resource value: 0x7f040033
public const int notification_template_part_chronometer = 2130968627; public const int notification_template_part_time = 2130968627;
// aapt resource value: 0x7f040034 // aapt resource value: 0x7f040034
public const int notification_template_part_time = 2130968628; public const int select_dialog_item_material = 2130968628;
// aapt resource value: 0x7f040035 // aapt resource value: 0x7f040035
public const int select_dialog_item_material = 2130968629; public const int select_dialog_multichoice_material = 2130968629;
// aapt resource value: 0x7f040036 // aapt resource value: 0x7f040036
public const int select_dialog_multichoice_material = 2130968630; public const int select_dialog_singlechoice_material = 2130968630;
// aapt resource value: 0x7f040037 // aapt resource value: 0x7f040037
public const int select_dialog_singlechoice_material = 2130968631; public const int support_simple_spinner_dropdown_item = 2130968631;
// aapt resource value: 0x7f040038
public const int support_simple_spinner_dropdown_item = 2130968632;
static Layout() static Layout()
{ {

@ -1,40 +1,69 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:orientation="vertical"
> >
<include <include
layout="@layout/commonTopBar" layout="@layout/commonTopBar"
android:id="@+id/commonTopBar" android:id="@+id/commonTopBar"
/> />
<LinearLayout <!-- The content itself -->
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_below="@id/commonTopBar" android:layout_below="@id/commonTopBar"
android:orientation="vertical"> android:orientation="vertical">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:id="@+id/recyclerView1" /> android:id="@+id/recyclerView1"
/>
<TextView
android:layout_width="match_parent" <RelativeLayout
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Hello World!" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/progressBar1" /> android:gravity="bottom|end"
<!-- Alternative: SeekBar --> android:layout_marginLeft="5pt"
android:layout_marginRight="5pt"
android:layout_marginBottom="5pt"
android:id="@+id/currentSongBar"
>
<android.support.design.widget.FloatingActionButton
android:layout_width="@dimen/design_fab_size_mini"
android:layout_height="@dimen/design_fab_size_mini"
android:id="@+id/currentSongInteractButton"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_margin="0pt"
app:elevation="0dp"
/>
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/currentSongProgress"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/currentSongInteractButton"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/currentSong"
android:text="Hello World!"
android:layout_alignParentLeft="true"
android:textAlignment="center"
android:layout_toLeftOf="@id/currentSongInteractButton"
android:layout_above="@id/currentSongProgress"
/>
<!-- Alternative: SeekBar -->
</RelativeLayout>
</LinearLayout> </android.support.design.widget.CoordinatorLayout>
</RelativeLayout> </LinearLayout>
Loading…
Cancel
Save