diff --git a/app/build.gradle b/app/build.gradle index f22492aef..a690a9add 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -95,4 +95,5 @@ dependencies { implementation "com.squareup.okhttp3:okhttp:$okHttpLibVersion" debugImplementation "com.facebook.stetho:stetho-okhttp3:$stethoLibVersion" + implementation 'com.android.support.constraint:constraint-layout:1.1.2' } diff --git a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java index 1665f7c5f..56a2862bb 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java @@ -22,15 +22,18 @@ import android.view.View; import android.view.ViewGroup; import org.schabi.newpipe.BaseFragment; +import org.schabi.newpipe.MainActivity; import org.schabi.newpipe.R; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.ServiceList; import org.schabi.newpipe.extractor.StreamingService; +import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.kiosk.KioskList; import org.schabi.newpipe.fragments.list.channel.ChannelFragment; import org.schabi.newpipe.local.feed.FeedFragment; import org.schabi.newpipe.fragments.list.kiosk.KioskFragment; import org.schabi.newpipe.local.bookmark.BookmarkFragment; +import org.schabi.newpipe.local.history.StatisticsPlaylistFragment; import org.schabi.newpipe.local.subscription.SubscriptionFragment; import org.schabi.newpipe.report.ErrorActivity; import org.schabi.newpipe.report.UserAction; @@ -39,10 +42,28 @@ import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.ServiceHelper; import org.schabi.newpipe.util.ThemeHelper; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static org.schabi.newpipe.util.NavigationHelper.MAIN_FRAGMENT_TAG; + public class MainFragment extends BaseFragment implements TabLayout.OnTabSelectedListener { public int currentServiceId = -1; private ViewPager viewPager; + private List tabs = new ArrayList<>(); + static PagerAdapter adapter; + TabLayout tabLayout; + private SharedPreferences prefs; + private Bundle savedInstanceStateBundle; + + SharedPreferences.OnSharedPreferenceChangeListener listener = (prefs, key) -> { + if(key.equals("saveUsedTabs")||key.equals("service")) { + mainPageChanged(); + } + }; + /*////////////////////////////////////////////////////////////////////////// // Constants @@ -60,6 +81,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte @Override public void onCreate(Bundle savedInstanceState) { + savedInstanceStateBundle = savedInstanceState; super.onCreate(savedInstanceState); setHasOptionsMenu(true); } @@ -67,6 +89,9 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { currentServiceId = ServiceHelper.getSelectedServiceId(activity); + + prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + prefs.registerOnSharedPreferenceChangeListener(listener); return inflater.inflate(R.layout.fragment_main, container, false); } @@ -74,31 +99,49 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte protected void initViews(View rootView, Bundle savedInstanceState) { super.initViews(rootView, savedInstanceState); - TabLayout tabLayout = rootView.findViewById(R.id.main_tab_layout); + getTabOrder(); + + tabLayout = rootView.findViewById(R.id.main_tab_layout); viewPager = rootView.findViewById(R.id.pager); /* Nested fragment, use child fragment here to maintain backstack in view pager. */ - PagerAdapter adapter = new PagerAdapter(getChildFragmentManager()); + adapter = new PagerAdapter(getChildFragmentManager()); viewPager.setAdapter(adapter); viewPager.setOffscreenPageLimit(adapter.getCount()); tabLayout.setupWithViewPager(viewPager); + } - int channelIcon = ThemeHelper.resolveResourceIdFromAttr(activity, R.attr.ic_channel); - int whatsHotIcon = ThemeHelper.resolveResourceIdFromAttr(activity, R.attr.ic_hot); - int bookmarkIcon = ThemeHelper.resolveResourceIdFromAttr(activity, R.attr.ic_bookmark); + private void getTabOrder() { + tabs.clear(); - //assign proper icons to tabs - /* - if (isSubscriptionsPageOnlySelected()) { - tabLayout.getTabAt(0).setIcon(channelIcon); - tabLayout.getTabAt(1).setIcon(bookmarkIcon); - } else { - tabLayout.getTabAt(0).setIcon(whatsHotIcon); - tabLayout.getTabAt(1).setIcon(channelIcon); - tabLayout.getTabAt(2).setIcon(bookmarkIcon); + String save = prefs.getString("saveUsedTabs", "1\n2\n4\n"); + String tabsArray[] = save.trim().split("\n"); + + KioskList kl = null; + + try { + StreamingService service = NewPipe.getService(currentServiceId); + kl = service.getKioskList(); + } catch (Exception e) { + ErrorActivity.reportError(activity, e, + activity.getClass(), + null, + ErrorActivity.ErrorInfo.make(UserAction.UI_ERROR, + "none", "", R.string.app_ui_crash)); + } + + for(String tabNumber:tabsArray) { + if(tabNumber.equals("1")) { + if (kl != null) { + for(String ks : kl.getAvailableKiosks()) { + tabs.add(tabNumber+"\t"+ks); + } + } + } else { + tabs.add(tabNumber); + } } - */ } /*////////////////////////////////////////////////////////////////////////// @@ -151,6 +194,11 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte public void onTabReselected(TabLayout.Tab tab) { } + public void mainPageChanged() { + getTabOrder(); + adapter.notifyDataSetChanged(); + } + private class PagerAdapter extends FragmentPagerAdapter { PagerAdapter(FragmentManager fm) { super(fm); @@ -158,30 +206,83 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte @Override public Fragment getItem(int position) { - //return proper fragments + String tabNumber = tabs.get(position); + + if(tabNumber.startsWith("1\t")) { + String kiosk[] = tabNumber.split("\t"); + if(kiosk.length==2) { + KioskFragment fragment = null; + try { + tabLayout.getTabAt(position).setIcon(KioskTranslator.getKioskIcons(kiosk[1], getContext())); + + fragment = KioskFragment.getInstance(currentServiceId, kiosk[1]); + fragment.useAsFrontPage(true); + return fragment; + } catch (Exception e) { + ErrorActivity.reportError(activity, e, + activity.getClass(), + null, + ErrorActivity.ErrorInfo.make(UserAction.UI_ERROR, + "none", "", R.string.app_ui_crash)); + } + } + } else if(tabNumber.startsWith("6\t")) { + String channelInfo[] = tabNumber.split("\t"); + if(channelInfo.length==4) { + tabLayout.getTabAt(position).setIcon(R.drawable.ic_channel_white_24dp); + + ChannelFragment fragment = ChannelFragment.getInstance(Integer.parseInt(channelInfo[3]), channelInfo[1], channelInfo[2]); + fragment.useAsFrontPage(true); + return fragment; + } else { + return new BlankFragment(); + } + } else { + switch (tabNumber) { + case "0": + tabLayout.getTabAt(position).setIcon(R.drawable.ic_whatshot_white_24dp); + + return new BlankFragment(); + case "2": + tabLayout.getTabAt(position).setIcon(R.drawable.ic_channel_white_24dp); + + SubscriptionFragment sfragment = new SubscriptionFragment(); + sfragment.useAsFrontPage(true); + return sfragment; + case "3": + tabLayout.getTabAt(position).setIcon(R.drawable.ic_rss_feed_white_24dp); + + FeedFragment ffragment = new FeedFragment(); + ffragment.useAsFrontPage(true); + return ffragment; + case "4": + tabLayout.getTabAt(position).setIcon(R.drawable.ic_bookmark_white_24dp); + + BookmarkFragment bFragment = new BookmarkFragment(); + bFragment.useAsFrontPage(true); + return bFragment; + case "5": + tabLayout.getTabAt(position).setIcon(R.drawable.ic_history_white_24dp); + + StatisticsPlaylistFragment cFragment = new StatisticsPlaylistFragment(); + cFragment.useAsFrontPage(true); + return cFragment; + } + } + return new BlankFragment(); - } + } @Override - public CharSequence getPageTitle(int position) { - //return getString(this.tabTitles[position]); - return ""; + public int getItemPosition(Object object) { + // Causes adapter to reload all Fragments when + // notifyDataSetChanged is called + return POSITION_NONE; } @Override public int getCount() { - //return number of framgents - return 10; + return tabs.size(); } } - - /*////////////////////////////////////////////////////////////////////////// - // Main page content - //////////////////////////////////////////////////////////////////////////*/ - - private boolean isSubscriptionsPageOnlySelected() { - return PreferenceManager.getDefaultSharedPreferences(activity) - .getString(getString(R.string.main_page_content_key), getString(R.string.blank_page_key)) - .equals(getString(R.string.subscription_page_key)); - } } diff --git a/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java index c2c813a4d..04d9c9dfe 100644 --- a/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java @@ -96,6 +96,14 @@ public class StatisticsPlaylistFragment return inflater.inflate(R.layout.fragment_playlist, container, false); } + @Override + public void setUserVisibleHint(boolean isVisibleToUser) { + super.setUserVisibleHint(isVisibleToUser); + if (activity != null && isVisibleToUser) { + setTitle(activity.getString(R.string.title_activity_history)); + } + } + /////////////////////////////////////////////////////////////////////////// // Fragment LifeCycle - Views /////////////////////////////////////////////////////////////////////////// diff --git a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsDialog.java b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsDialog.java index 6cc63dd5e..bea5a0fba 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsDialog.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsDialog.java @@ -1,6 +1,13 @@ package org.schabi.newpipe.settings; +import android.app.Dialog; +import android.content.Context; +import android.content.SharedPreferences; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.drawable.Drawable; import android.os.Bundle; +import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.DialogFragment; @@ -20,26 +27,122 @@ import java.util.List; public class ContentSettingsDialog extends DialogFragment { + + public AllAdapter allAdapter; + public UsedAdapter usedAdapter; + List usedTabs = new ArrayList<>(); + public String[] allTabs = new String[7]; + @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.dialog_contentsettings, container); } + @Override public void onViewCreated(@NonNull View rootView, @Nullable Bundle savedInstanceState) { super.onViewCreated(rootView, savedInstanceState); + + tabNames(); + initButtons(rootView); + initUsedTabs(); + RecyclerView allTabs = rootView.findViewById(R.id.tabs); allTabs.setLayoutManager(new LinearLayoutManager(getContext())); - allTabs.setAdapter(new allAdapter()); + allAdapter = new AllAdapter(); + allTabs.setAdapter(allAdapter); + allTabs.addItemDecoration(new DividerItemDecoration(getActivity())); RecyclerView usedTabs = rootView.findViewById(R.id.usedTabs); usedTabs.setLayoutManager(new LinearLayoutManager(getContext())); + usedAdapter = new UsedAdapter(); + usedTabs.setAdapter(usedAdapter); + usedTabs.addItemDecoration(new DividerItemDecoration(getActivity())); } - public class allAdapter extends RecyclerView.Adapter{ + private void initButtons(View rootView){ + rootView.findViewById(R.id.cancelText).setOnClickListener((v -> { + dismiss(); + })); + + rootView.findViewById(R.id.confirmText).setOnClickListener((v -> { + StringBuilder save = new StringBuilder(); + if(usedTabs.size()==0) { + save = new StringBuilder("0"); + } else { + for(String s: usedTabs) { + save.append(s); + save.append("\n"); + } + } + + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getContext()); + SharedPreferences.Editor editor = sharedPreferences.edit(); + editor.putString("saveUsedTabs", save.toString()); + editor.commit(); + dismiss(); + })); + } + + private void initUsedTabs() { + String save = PreferenceManager.getDefaultSharedPreferences(getContext()).getString("saveUsedTabs", "1\n2\n4\n"); + String tabs[] = save.trim().split("\n"); + usedTabs.addAll(Arrays.asList(tabs)); + } + + private void tabNames() { + allTabs[0] = getString(R.string.blank_page_summary); + allTabs[1] = getString(R.string.kiosk_page_summary); + allTabs[2] = getString(R.string.subscription_page_summary); + allTabs[3] = getString(R.string.feed_page_summary); + allTabs[4] = getString(R.string.tab_bookmarks); + allTabs[5] = getString(R.string.title_activity_history); + allTabs[6] = getString(R.string.channel_page_summary); + } + + private void addTab(int position) { + if(position!=6) { + usedTabs.add(String.valueOf(position)); + usedAdapter.notifyDataSetChanged(); + } else { + SelectChannelFragment selectChannelFragment = new SelectChannelFragment(); + selectChannelFragment.setOnSelectedLisener((String url, String name, int service) -> { + usedTabs.add(position+"\t"+url+"\t"+name+"\t"+service); + usedAdapter.notifyDataSetChanged(); + }); + selectChannelFragment.show(getFragmentManager(), "select_channel"); + } + } + + private void removeTab(int position) { + usedTabs.remove(position); + usedAdapter.notifyDataSetChanged(); + } + + private void upTab(int position){ + String first = usedTabs.get(position - 1); + String second = usedTabs.get(position); + + usedTabs.set(position - 1, second); + usedTabs.set(position, first); + + usedAdapter.notifyDataSetChanged(); + } + + private void downTab(int position){ + String first = usedTabs.get(position + 1); + String second = usedTabs.get(position); + + usedTabs.set(position + 1, second); + usedTabs.set(position, first); + + usedAdapter.notifyDataSetChanged(); + } + + public class AllAdapter extends RecyclerView.Adapter{ @Override public TabViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { @@ -54,45 +157,142 @@ public class ContentSettingsDialog extends DialogFragment { holder.bind(position); } - - // Return the size of your dataset (invoked by the layout manager) @Override public int getItemCount() { - return 5; + return allTabs.length; } class TabViewHolder extends RecyclerView.ViewHolder { TextView text; Button add; + Button up; + Button down; public TabViewHolder(View itemView) { super(itemView); text = itemView.findViewById(R.id.tabName); add = itemView.findViewById(R.id.buttonAddRemove); + up = itemView.findViewById(R.id.buttonUp); + down = itemView.findViewById(R.id.buttonDown); } void bind(int position) { + up.setBackgroundResource(0); + down.setBackgroundResource(0); + text.setText(allTabs[position]); add.setBackgroundResource(R.drawable.ic_add); - switch (position) { - case 0: - text.setText("Test"); - break; - case 1: - break; - case 2: - break; - case 3: - break; - case 4: - break; - case 5: - break; - case 6: - break; - } + add.setOnClickListener(v -> { + addTab(position); + }); + } } } + + public class UsedAdapter extends RecyclerView.Adapter{ + + @Override + public TabViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + LayoutInflater inflater = LayoutInflater.from(getContext()); + View view = inflater.inflate(R.layout.dialog_contentsettingtab, parent, false); + return new TabViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull TabViewHolder holder, int position) { + holder.bind(position); + } + + @Override + public int getItemCount() { + return usedTabs.size(); + } + + class TabViewHolder extends RecyclerView.ViewHolder { + + TextView text; + Button remove; + Button up; + Button down; + + public TabViewHolder(View itemView) { + super(itemView); + + text = itemView.findViewById(R.id.tabName); + remove = itemView.findViewById(R.id.buttonAddRemove); + up = itemView.findViewById(R.id.buttonUp); + down = itemView.findViewById(R.id.buttonDown); + } + + void bind(int position) { + if(position!=0) { + up.setBackgroundResource(R.drawable.ic_arrow_up_white); + up.setOnClickListener(v -> { + upTab(position); + }); + } else up.setBackgroundResource(0); + + if(position!=usedTabs.size()-1) { + down.setBackgroundResource(R.drawable.ic_arrow_down_white); + down.setOnClickListener(v -> { + downTab(position); + }); + } else down.setBackgroundResource(0); + + if(usedTabs.get(position).startsWith("6\t")) { + String channelInfo[] = usedTabs.get(position).split("\t"); + String channelName = ""; + if(channelInfo.length==4) channelName = channelInfo[2]; + String textToSet = allTabs[6]+": "+channelName; + text.setText(textToSet); + } else { + text.setText(allTabs[Integer.parseInt(usedTabs.get(position))]); + } + + remove.setBackgroundResource(R.drawable.ic_remove); + remove.setOnClickListener(v -> { + removeTab(position); + }); + + } + } + } + + public class DividerItemDecoration extends RecyclerView.ItemDecoration { + + private final int[] ATTRS = new int[]{android.R.attr.listDivider}; + + private Drawable divider; + + public DividerItemDecoration(Context context) { + final TypedArray styledAttributes = context.obtainStyledAttributes(ATTRS); + divider = styledAttributes.getDrawable(0); + styledAttributes.recycle(); + } + + + @Override + public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) { + int left = parent.getPaddingLeft(); + int right = parent.getWidth() - parent.getPaddingRight(); + + int childCount = parent.getChildCount(); + for (int i = 0; i < childCount; i++) { + View child = parent.getChildAt(i); + + RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams(); + + int top = child.getBottom() + params.bottomMargin; + int bottom = top + divider.getIntrinsicHeight(); + + divider.setBounds(left, top, right, bottom); + divider.draw(c); + } + } + } + + } diff --git a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java index cf535ed09..d856dbe48 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java @@ -2,6 +2,7 @@ package org.schabi.newpipe.settings; import android.app.Activity; import android.app.AlertDialog; +import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; @@ -10,9 +11,11 @@ import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentTransaction; import android.support.v7.preference.ListPreference; import android.support.v7.preference.Preference; import android.util.Log; +import android.widget.LinearLayout; import android.widget.Toast; import com.nononsenseapps.filepicker.Utils; @@ -99,75 +102,9 @@ public class ContentSettingsFragment extends BasePreferenceFragment { addPreferencesFromResource(R.xml.content_settings); - /* - - final ListPreference mainPageContentPref = (ListPreference) findPreference(getString(R.string.main_page_content_key)); - mainPageContentPref.setOnPreferenceChangeListener((Preference preference, Object newValueO) -> { - final String newValue = newValueO.toString(); - - final String mainPrefOldValue = - defaultPreferences.getString(getString(R.string.main_page_content_key), "blank_page"); - final String mainPrefOldSummary = getMainPagePrefSummery(mainPrefOldValue, mainPageContentPref); - - if(newValue.equals(getString(R.string.kiosk_page_key))) { - SelectKioskFragment selectKioskFragment = new SelectKioskFragment(); - selectKioskFragment.setOnSelectedLisener((String kioskId, int service_id) -> { - defaultPreferences.edit() - .putInt(getString(R.string.main_page_selected_service), service_id).apply(); - defaultPreferences.edit() - .putString(getString(R.string.main_page_selectd_kiosk_id), kioskId).apply(); - String serviceName = ""; - try { - serviceName = NewPipe.getService(service_id).getServiceInfo().getName(); - } catch (ExtractionException e) { - onError(e); - } - String kioskName = KioskTranslator.getTranslatedKioskName(kioskId, - getContext()); - - String summary = - String.format(getString(R.string.service_kiosk_string), - serviceName, - kioskName); - - mainPageContentPref.setSummary(summary); - }); - selectKioskFragment.setOnCancelListener(() -> { - mainPageContentPref.setSummary(mainPrefOldSummary); - mainPageContentPref.setValue(mainPrefOldValue); - }); - selectKioskFragment.show(getFragmentManager(), "select_kiosk"); - } else if(newValue.equals(getString(R.string.channel_page_key))) { - SelectChannelFragment selectChannelFragment = new SelectChannelFragment(); - selectChannelFragment.setOnSelectedLisener((String url, String name, int service) -> { - defaultPreferences.edit() - .putInt(getString(R.string.main_page_selected_service), service).apply(); - defaultPreferences.edit() - .putString(getString(R.string.main_page_selected_channel_url), url).apply(); - defaultPreferences.edit() - .putString(getString(R.string.main_page_selected_channel_name), name).apply(); - - mainPageContentPref.setSummary(name); - }); - selectChannelFragment.setOnCancelListener(() -> { - mainPageContentPref.setSummary(mainPrefOldSummary); - mainPageContentPref.setValue(mainPrefOldValue); - }); - selectChannelFragment.show(getFragmentManager(), "select_channel"); - } else { - mainPageContentPref.setSummary(getMainPageSummeryByKey(newValue)); - } - - defaultPreferences.edit().putBoolean(Constants.KEY_MAIN_PAGE_CHANGE, true).apply(); - - return true; - }); - - */ - Preference contentPreference = findPreference(getString(R.string.main_page_content_key)); contentPreference.setOnPreferenceClickListener((Preference p) -> { - new ContentSettingsDialog().show(getFragmentManager(),""); + new ContentSettingsDialog().show(getFragmentManager(),"select_content"); return true; }); diff --git a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java index 7c781eb14..15350c180 100644 --- a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java @@ -10,6 +10,7 @@ import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.ServiceList; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ExtractionException; +import org.schabi.newpipe.fragments.MainFragment; import java.util.concurrent.TimeUnit; diff --git a/app/src/main/res/drawable-hdpi/ic_add.png b/app/src/main/res/drawable-hdpi/ic_add.png index 85172125e..1ae5b2dc4 100644 Binary files a/app/src/main/res/drawable-hdpi/ic_add.png and b/app/src/main/res/drawable-hdpi/ic_add.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_arrow_down_white.png b/app/src/main/res/drawable-hdpi/ic_arrow_down_white.png new file mode 100644 index 000000000..33939600d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_arrow_down_white.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_arrow_up_white.png b/app/src/main/res/drawable-hdpi/ic_arrow_up_white.png new file mode 100644 index 000000000..0972a9bca Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_arrow_up_white.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_remove.png b/app/src/main/res/drawable-hdpi/ic_remove.png new file mode 100644 index 000000000..75e65bc9c Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_remove.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_add.png b/app/src/main/res/drawable-mdpi/ic_add.png index b13ffb57c..d51f0ddad 100644 Binary files a/app/src/main/res/drawable-mdpi/ic_add.png and b/app/src/main/res/drawable-mdpi/ic_add.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_arrow_down_white.png b/app/src/main/res/drawable-mdpi/ic_arrow_down_white.png new file mode 100644 index 000000000..40a0f499e Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_arrow_down_white.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_arrow_up_white.png b/app/src/main/res/drawable-mdpi/ic_arrow_up_white.png new file mode 100644 index 000000000..fe67b4673 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_arrow_up_white.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_remove.png b/app/src/main/res/drawable-mdpi/ic_remove.png new file mode 100644 index 000000000..a1816d4c6 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_remove.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_add.png b/app/src/main/res/drawable-xhdpi/ic_add.png index cbe4b6000..9ea0eeb7e 100644 Binary files a/app/src/main/res/drawable-xhdpi/ic_add.png and b/app/src/main/res/drawable-xhdpi/ic_add.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_arrow_down_white.png b/app/src/main/res/drawable-xhdpi/ic_arrow_down_white.png new file mode 100644 index 000000000..86bc5db3b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_arrow_down_white.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_arrow_up_white.png b/app/src/main/res/drawable-xhdpi/ic_arrow_up_white.png new file mode 100644 index 000000000..dda36882e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_arrow_up_white.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_remove.png b/app/src/main/res/drawable-xhdpi/ic_remove.png new file mode 100644 index 000000000..ffbdaa6ed Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_remove.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_add.png b/app/src/main/res/drawable-xxhdpi/ic_add.png index d97861c9a..75f192aab 100644 Binary files a/app/src/main/res/drawable-xxhdpi/ic_add.png and b/app/src/main/res/drawable-xxhdpi/ic_add.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_arrow_down_white.png b/app/src/main/res/drawable-xxhdpi/ic_arrow_down_white.png new file mode 100644 index 000000000..7e901e098 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_arrow_down_white.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_arrow_up_white.png b/app/src/main/res/drawable-xxhdpi/ic_arrow_up_white.png new file mode 100644 index 000000000..bc71e23de Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_arrow_up_white.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_remove.png b/app/src/main/res/drawable-xxhdpi/ic_remove.png new file mode 100644 index 000000000..d35469d3c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_remove.png differ diff --git a/app/src/main/res/layout/dialog_contentsettings.xml b/app/src/main/res/layout/dialog_contentsettings.xml index 9303cb995..e48eaab13 100644 --- a/app/src/main/res/layout/dialog_contentsettings.xml +++ b/app/src/main/res/layout/dialog_contentsettings.xml @@ -1,38 +1,61 @@ - - - - - - - - - - - + + + + + + + + + + + + + + @@ -40,21 +63,21 @@ android:id="@+id/cancelText" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_weight="1" android:padding="4dp" android:paddingLeft="6dp" android:paddingRight="6dp" android:text="@string/cancel" - android:textColor="@color/black_settings_accent_color" /> + android:textColor="@color/black_settings_accent_color" + android:textStyle="bold" /> + android:textColor="@color/black_settings_accent_color" + android:textStyle="bold" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_contentsettingtab.xml b/app/src/main/res/layout/dialog_contentsettingtab.xml index baad35b7b..09d59a6d9 100644 --- a/app/src/main/res/layout/dialog_contentsettingtab.xml +++ b/app/src/main/res/layout/dialog_contentsettingtab.xml @@ -8,36 +8,46 @@ android:id="@+id/tabName" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="22dp" - android:layout_marginStart="22dp" /> + android:layout_marginLeft="2dp" + android:layout_marginStart="0dp" + android:paddingBottom="2dp" + android:paddingLeft="2dp" + android:paddingStart="3dp" + android:paddingTop="2dp" + android:textColor="@color/background_title_color" + android:textSize="24sp" + android:layout_toStartOf="@id/buttonDown" + android:layout_toLeftOf="@id/buttonDown" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" />