From 03520b55e7ebd6eb5c32d2dd8f31779acb8eff15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schu=CC=88ller?= Date: Wed, 14 Mar 2018 14:33:17 +0100 Subject: [PATCH] Added search button --- README.md | 1 + .../schueller/peertube/activity/VideoListActivity.java | 10 ++++++++++ .../net/schueller/peertube/adapter/VideoAdapter.java | 4 ---- app/src/main/res/menu/menu_main.xml | 7 +++++++ app/src/main/res/values/strings.xml | 1 + 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3b2026f..d2e0777 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ - [ ] Comment video - [ ] Unit Tests - [ ] App Icon and assets +- [ ] Search - [ ] Lots more missing at this point... diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java index f06aedc..233fc11 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java @@ -145,6 +145,11 @@ public class VideoListActivity extends AppCompatActivity { inflater.inflate(R.menu.menu_main, menu); // 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( new IconDrawable(this, FontAwesomeIcons.fa_cog) .colorRes(R.color.cardview_light_background) @@ -162,6 +167,11 @@ public class VideoListActivity extends AppCompatActivity { switch (item.getItemId()) { // 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: // Toast.makeText(this, "Login Selected", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(this, SettingsActivity.class); diff --git a/app/src/main/java/net/schueller/peertube/adapter/VideoAdapter.java b/app/src/main/java/net/schueller/peertube/adapter/VideoAdapter.java index 6b4debd..6d4ee3c 100644 --- a/app/src/main/java/net/schueller/peertube/adapter/VideoAdapter.java +++ b/app/src/main/java/net/schueller/peertube/adapter/VideoAdapter.java @@ -2,11 +2,8 @@ package net.schueller.peertube.adapter; import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; -import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; -import android.text.format.DateUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -19,7 +16,6 @@ import net.schueller.peertube.R; import net.schueller.peertube.activity.TorrentVideoPlayActivity; import net.schueller.peertube.helper.APIUrlHelper; import net.schueller.peertube.helper.MetaDataHelper; -import net.schueller.peertube.model.Account; import net.schueller.peertube.model.Avatar; import net.schueller.peertube.model.Video; diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index 1e92997..b2d252f 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -4,6 +4,13 @@ xmlns:tools="http://schemas.android.com/tools" tools:context="activity.VideoListActivity"> + + + + Search Settings