Added search button

This commit is contained in:
Stefan Schüller 2018-03-14 14:33:17 +01:00
parent 7145f04375
commit 03520b55e7
5 changed files with 19 additions and 4 deletions

View File

@ -27,6 +27,7 @@
- [ ] Comment video - [ ] Comment video
- [ ] Unit Tests - [ ] Unit Tests
- [ ] App Icon and assets - [ ] App Icon and assets
- [ ] Search
- [ ] Lots more missing at this point... - [ ] Lots more missing at this point...

View File

@ -145,6 +145,11 @@ public class VideoListActivity extends AppCompatActivity {
inflater.inflate(R.menu.menu_main, menu); inflater.inflate(R.menu.menu_main, menu);
// Set an icon in the ActionBar // Set an icon in the ActionBar
menu.findItem(R.id.action_search).setIcon(
new IconDrawable(this, FontAwesomeIcons.fa_search)
.colorRes(R.color.cardview_light_background)
.actionBarSize());
menu.findItem(R.id.action_settings).setIcon( menu.findItem(R.id.action_settings).setIcon(
new IconDrawable(this, FontAwesomeIcons.fa_cog) new IconDrawable(this, FontAwesomeIcons.fa_cog)
.colorRes(R.color.cardview_light_background) .colorRes(R.color.cardview_light_background)
@ -162,6 +167,11 @@ public class VideoListActivity extends AppCompatActivity {
switch (item.getItemId()) { switch (item.getItemId()) {
// action with ID action_refresh was selected // action with ID action_refresh was selected
case R.id.action_search:
// TODO: implement
Toast.makeText(this, "Search Selected", Toast.LENGTH_SHORT).show();
return false;
case R.id.action_settings: case R.id.action_settings:
// Toast.makeText(this, "Login Selected", Toast.LENGTH_SHORT).show(); // Toast.makeText(this, "Login Selected", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class); Intent intent = new Intent(this, SettingsActivity.class);

View File

@ -2,11 +2,8 @@ package net.schueller.peertube.adapter;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.format.DateUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -19,7 +16,6 @@ import net.schueller.peertube.R;
import net.schueller.peertube.activity.TorrentVideoPlayActivity; import net.schueller.peertube.activity.TorrentVideoPlayActivity;
import net.schueller.peertube.helper.APIUrlHelper; import net.schueller.peertube.helper.APIUrlHelper;
import net.schueller.peertube.helper.MetaDataHelper; import net.schueller.peertube.helper.MetaDataHelper;
import net.schueller.peertube.model.Account;
import net.schueller.peertube.model.Avatar; import net.schueller.peertube.model.Avatar;
import net.schueller.peertube.model.Video; import net.schueller.peertube.model.Video;

View File

@ -4,6 +4,13 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context="activity.VideoListActivity"> tools:context="activity.VideoListActivity">
<item
android:id="@+id/action_search"
android:orderInCategory="300"
android:title="@string/action_bar_title_search"
app:showAsAction="always" />
<item <item
android:id="@+id/action_settings" android:id="@+id/action_settings"
android:orderInCategory="300" android:orderInCategory="300"

View File

@ -20,6 +20,7 @@
</string> </string>
<!-- Action bar --> <!-- Action bar -->
<string name="action_bar_title_search">Search</string>
<string name="action_bar_title_settings">Settings</string> <string name="action_bar_title_settings">Settings</string>
<!-- Bottom navigation bar --> <!-- Bottom navigation bar -->