diff options
Diffstat (limited to 'app/src/main')
12 files changed, 513 insertions, 22 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index f96764b42..d57199941 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -60,6 +60,7 @@ import de.danoeh.antennapod.fragment.ExternalPlayerFragment; import de.danoeh.antennapod.fragment.ItemlistFragment; import de.danoeh.antennapod.fragment.PlaybackHistoryFragment; import de.danoeh.antennapod.fragment.QueueFragment; +import de.danoeh.antennapod.fragment.SubscriptionFragment; import de.danoeh.antennapod.menuhandler.NavDrawerActivity; import de.danoeh.antennapod.preferences.PreferenceController; import de.greenrobot.event.EventBus; @@ -95,6 +96,7 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity EpisodesFragment.TAG, DownloadsFragment.TAG, PlaybackHistoryFragment.TAG, + SubscriptionFragment.TAG, AddFeedFragment.TAG }; @@ -201,10 +203,10 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity } private void saveLastNavFragment(String tag) { - Log.d(TAG, "saveLastNavFragment(tag: " + tag +")"); + Log.d(TAG, "saveLastNavFragment(tag: " + tag + ")"); SharedPreferences prefs = getSharedPreferences(PREF_NAME, MODE_PRIVATE); SharedPreferences.Editor edit = prefs.edit(); - if(tag != null) { + if (tag != null) { edit.putString(PREF_LAST_FRAGMENT_TAG, tag); } else { edit.remove(PREF_LAST_FRAGMENT_TAG); @@ -270,7 +272,7 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity } public void loadFragment(int index, Bundle args) { - Log.d(TAG, "loadFragment(index: " + index + ", args: " + args +")"); + Log.d(TAG, "loadFragment(index: " + index + ", args: " + args + ")"); if (index < navAdapter.getSubscriptionOffset()) { String tag = navAdapter.getTags().get(index); loadFragment(tag, args); @@ -299,6 +301,11 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity case AddFeedFragment.TAG: fragment = new AddFeedFragment(); break; + case SubscriptionFragment.TAG: + SubscriptionFragment subscriptionFragment = new SubscriptionFragment(); + subscriptionFragment.setItemAccess(itemAccess); + fragment = subscriptionFragment; + break; default: // default to the queue tag = QueueFragment.TAG; @@ -315,8 +322,9 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity loadFragment(fragment); } + private void loadFeedFragmentByPosition(int relPos, Bundle args) { - if(relPos < 0) { + if (relPos < 0) { return; } Feed feed = itemAccess.getItem(relPos); @@ -325,13 +333,21 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity public void loadFeedFragmentById(long feedId, Bundle args) { Fragment fragment = ItemlistFragment.newInstance(feedId); - if(args != null) { + if (args != null) { fragment.setArguments(args); } saveLastNavFragment(String.valueOf(feedId)); currentTitle = ""; getSupportActionBar().setTitle(currentTitle); - loadFragment(fragment); + loadChildFragment(fragment); + } + + private void loadFeedFragment(Feed feed) { + long feedId = feed.getId(); + Fragment fragment = ItemlistFragment.newInstance(feedId); + currentTitle = ""; + getSupportActionBar().setTitle(currentTitle); + loadChildFragment(fragment); } private void loadFragment(Fragment fragment) { @@ -370,14 +386,14 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity private int getSelectedNavListIndex() { String currentFragment = getLastNavFragment(); - if(currentFragment == null) { + if (currentFragment == null) { // should not happen, but better safe than sorry return -1; } int tagIndex = navAdapter.getTags().indexOf(currentFragment); - if(tagIndex >= 0) { + if (tagIndex >= 0) { return tagIndex; - } else if(ArrayUtils.contains(NAV_DRAWER_TAGS, currentFragment)) { + } else if (ArrayUtils.contains(NAV_DRAWER_TAGS, currentFragment)) { // the fragment was just hidden return -1; } else { // last fragment was not a list, but a feed @@ -408,7 +424,7 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity private AdapterView.OnItemLongClickListener newListLongClickListener = new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { - if(position < navAdapter.getTags().size()) { + if (position < navAdapter.getTags().size()) { showDrawerPreferencesDialog(); return true; } else { @@ -477,10 +493,10 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity super.onStop(); EventDistributor.getInstance().unregister(contentUpdate); EventBus.getDefault().unregister(this); - if(subscription != null) { + if (subscription != null) { subscription.unsubscribe(); } - if(pd != null) { + if (pd != null) { pd.dismiss(); } } @@ -517,12 +533,12 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); - if(v.getId() != R.id.nav_list) { + if (v.getId() != R.id.nav_list) { return; } AdapterView.AdapterContextMenuInfo adapterInfo = (AdapterView.AdapterContextMenuInfo) menuInfo; int position = adapterInfo.position; - if(position < navAdapter.getSubscriptionOffset()) { + if (position < navAdapter.getSubscriptionOffset()) { return; } MenuInflater inflater = getMenuInflater(); @@ -537,11 +553,11 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity public boolean onContextItemSelected(MenuItem item) { final int position = mPosition; mPosition = -1; // reset - if(position < 0) { + if (position < 0) { return false; } Feed feed = navDrawerData.feeds.get(position - navAdapter.getSubscriptionOffset()); - switch(item.getItemId()) { + switch (item.getItemId()) { case R.id.mark_all_seen_item: DBWriter.markFeedSeen(feed.getId()); return true; @@ -553,7 +569,7 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity @Override protected void onPostExecute(Void result) { super.onPostExecute(result); - if(getSelectedNavListIndex() == position) { + if (getSelectedNavListIndex() == position) { loadFragment(EpisodesFragment.TAG, null); } } @@ -574,7 +590,7 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity if (media.getItem().getFeed().getId() == feed.getId()) { Log.d(TAG, "Currently playing episode is about to be deleted, skipping"); remover.skipOnCompletion = true; - if(controller.getStatus() == PlayerStatus.PLAYING) { + if (controller.getStatus() == PlayerStatus.PLAYING) { sendBroadcast(new Intent( PlaybackService.ACTION_PAUSE_PLAY_CURRENT_EPISODE)); } @@ -594,7 +610,7 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity @Override public void onBackPressed() { - if(isDrawerOpen()) { + if (isDrawerOpen()) { drawerLayout.closeDrawer(navDrawer); } else { super.onBackPressed(); @@ -673,9 +689,13 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity loadData(); } + public void onEvent(SubscriptionFragment.SubscriptionEvent event) { + loadFeedFragment(event.feed); + } + public void onEventMainThread(ProgressEvent event) { Log.d(TAG, "onEvent(" + event + ")"); - switch(event.action) { + switch (event.action) { case START: pd = new ProgressDialog(this); pd.setMessage(event.message); @@ -684,7 +704,7 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity pd.show(); break; case END: - if(pd != null) { + if (pd != null) { pd.dismiss(); } break; diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java index d43e30d8f..b20af1773 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -19,6 +19,7 @@ import com.bumptech.glide.Glide; import com.joanzapata.iconify.Iconify; import com.joanzapata.iconify.widget.IconTextView; +import de.danoeh.antennapod.fragment.SubscriptionFragment; import org.apache.commons.lang3.ArrayUtils; import java.util.ArrayList; @@ -108,6 +109,9 @@ public class NavListAdapter extends BaseAdapter case PlaybackHistoryFragment.TAG: icon = R.attr.ic_history; break; + case SubscriptionFragment.TAG: + icon = R.attr.ic_folder; + break; case AddFeedFragment.TAG: icon = R.attr.content_new; break; @@ -127,7 +131,7 @@ public class NavListAdapter extends BaseAdapter @Override public int getCount() { - return getSubscriptionOffset() + itemAccess.getCount(); + return getSubscriptionOffset() ;//+ itemAccess.getCount(); //Avoid feed } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java new file mode 100644 index 000000000..0ff976b98 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java @@ -0,0 +1,70 @@ +package de.danoeh.antennapod.adapter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; + +import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.feed.Feed; +import de.danoeh.antennapod.view.SubscriptionViewItem; + +/** + * Adapter for subscriptions + */ +public class SubscriptionsAdapter extends BaseAdapter { + + private NavListAdapter.ItemAccess mItemAccess; + + private Context mContext; + + public SubscriptionsAdapter(Context context, NavListAdapter.ItemAccess itemAccess) { + mItemAccess = itemAccess; + mContext = context; + } + + public void setItemAccess(NavListAdapter.ItemAccess itemAccess) { + mItemAccess = itemAccess; + } + + @Override + public int getCount() { + return mItemAccess.getCount(); + } + + @Override + public Object getItem(int position) { + return mItemAccess.getItem(position); + } + + @Override + public long getItemId(int position) { + return 0; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + Holder holder; + final Feed item = (Feed) getItem(position); + if (item == null) return null; + + if (convertView == null) { + holder = new Holder(); + LayoutInflater inflater = + (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + convertView = inflater.inflate(R.layout.subscription_item, parent, false); + holder.itemView = (SubscriptionViewItem) convertView.findViewById(R.id.subscription_item); + convertView.setTag(holder); + } else { + holder = (Holder) convertView.getTag(); + } + + holder.itemView.setFeed(item); + return convertView; + } + + static class Holder { + SubscriptionViewItem itemView; + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java new file mode 100644 index 000000000..286212891 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java @@ -0,0 +1,113 @@ +package de.danoeh.antennapod.fragment; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.GridView; + +import java.util.ArrayList; +import java.util.List; + +import de.danoeh.antennapod.R; +import de.danoeh.antennapod.activity.MainActivity; +import de.danoeh.antennapod.adapter.NavListAdapter; +import de.danoeh.antennapod.adapter.SubscriptionsAdapter; +import de.danoeh.antennapod.core.feed.Feed; +import de.danoeh.antennapod.core.storage.DBReader; +import de.greenrobot.event.EventBus; +import rx.Observable; +import rx.android.schedulers.AndroidSchedulers; +import rx.schedulers.Schedulers; + +/** + * Fragment for displaying feed subscriptions + */ +public class SubscriptionFragment extends Fragment { + + public static final String TAG = "SubscriptionFragment"; + + private GridView mSubscriptionGridLayout; + private DBReader.NavDrawerData mDrawerData; + private SubscriptionsAdapter mSubscriptionAdapter; + private NavListAdapter.ItemAccess mItemAccess; + + private List<Feed> mSubscriptionList = new ArrayList<>(); + + + public SubscriptionFragment() { + } + + + public void setItemAccess(NavListAdapter.ItemAccess itemAccess) { + mItemAccess = itemAccess; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setRetainInstance(true); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View root = inflater.inflate(R.layout.fragment_subscriptions, container, false); + mSubscriptionGridLayout = (GridView) root.findViewById(R.id.subscriptions_grid); + return root; + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + mSubscriptionAdapter = new SubscriptionsAdapter(getActivity(), mItemAccess); + + mSubscriptionGridLayout.setAdapter(mSubscriptionAdapter); + + Observable.fromCallable(() -> loadData()) + .subscribeOn(Schedulers.newThread()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(result -> { + mDrawerData = result; + mSubscriptionList = mDrawerData.feeds; + mSubscriptionAdapter.setItemAccess(mItemAccess); + mSubscriptionAdapter.notifyDataSetChanged(); + }, error -> { + Log.e(TAG, Log.getStackTraceString(error)); + }); + + + mSubscriptionGridLayout.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { + EventBus.getDefault().post(new SubscriptionEvent(mSubscriptionList.get(position))); + } + }); + + if (getActivity() instanceof MainActivity) { + ((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.my_subscriptions); + } + + } + + @Override + public void onResume() { + super.onResume(); + } + + public class SubscriptionEvent { + public final Feed feed; + + SubscriptionEvent(Feed f) { + feed = f; + } + } + + + private DBReader.NavDrawerData loadData() { + return DBReader.getNavDrawerData(); + } +} diff --git a/app/src/main/java/de/danoeh/antennapod/utils/TimeUtils.java b/app/src/main/java/de/danoeh/antennapod/utils/TimeUtils.java new file mode 100644 index 000000000..bb0573e72 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/utils/TimeUtils.java @@ -0,0 +1,64 @@ +package de.danoeh.antennapod.utils; + + +import android.content.Context; + +import java.util.Date; + +import de.danoeh.antennapod.R; + +/* + * Copyright 2012 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//http://stackoverflow.com/questions/13018550/time-since-ago-library-for-android-java + + +public class TimeUtils { + private static final int SECOND_MILLIS = 1000; + private static final int MINUTE_MILLIS = 60 * SECOND_MILLIS; + private static final int HOUR_MILLIS = 60 * MINUTE_MILLIS; + private static final int DAY_MILLIS = 24 * HOUR_MILLIS; + + + public static String getTimeAgo(long time, Context ctx) { + if (time < 1000000000000L) { + // if timestamp given in seconds, convert to millis + time *= 1000; + } + + long now = new Date().getTime(); + if (time > now || time <= 0) { + return null; + } + + final long diff = now - time; + if (diff < MINUTE_MILLIS) { + return ctx.getString(R.string.time_just_now); + } else if (diff < 2 * MINUTE_MILLIS) { + return ctx.getString(R.string.time_a_min_ago); + } else if (diff < 50 * MINUTE_MILLIS) { + return diff / MINUTE_MILLIS + ctx.getString(R.string.time_min_ago); + } else if (diff < 90 * MINUTE_MILLIS) { + return ctx.getString(R.string.time_an_hour_ago); + } else if (diff < 24 * HOUR_MILLIS) { + return diff / HOUR_MILLIS + ctx.getString(R.string.time_hours_ago); + } else if (diff < 48 * HOUR_MILLIS) { + return ctx.getString(R.string.time_yesterday); + } else { + return diff / DAY_MILLIS + ctx.getString(R.string.time_days_ago); + } + } +}
\ No newline at end of file diff --git a/app/src/main/java/de/danoeh/antennapod/view/SubscriptionViewItem.java b/app/src/main/java/de/danoeh/antennapod/view/SubscriptionViewItem.java new file mode 100644 index 000000000..7703554f9 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/view/SubscriptionViewItem.java @@ -0,0 +1,89 @@ +package de.danoeh.antennapod.view; + +import android.content.Context; +import android.net.Uri; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.RequestListener; +import com.bumptech.glide.request.target.Target; + +import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.feed.Feed; + +/** + * Custom view for handling feed item. + */ +public class SubscriptionViewItem extends RelativeLayout { + + private ImageView mImageView; + private TextView mTextTime; + private TextView mUnreadCountText; + private TextView mFeedTitle; + private Context mContext; + + public SubscriptionViewItem(Context context) { + super(context); + init(context); + } + + public SubscriptionViewItem(Context context, AttributeSet attrs) { + super(context, attrs); + init(context); + } + + public SubscriptionViewItem(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + init(context); + } + + @Override + public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, widthMeasureSpec); + } + + private void init(Context context) { + mContext = context; + LayoutInflater mLayoutInflater = + (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + View view = mLayoutInflater.inflate(R.layout.subscription_view, this); + mTextTime = (TextView) view.findViewById(R.id.txtvTime); + mFeedTitle = (TextView) view.findViewById(R.id.txtvTitle); + mImageView = (ImageView) view.findViewById(R.id.imgvCover); + mUnreadCountText = (TextView) view.findViewById(R.id.unread_count_text); + } + + public void setFeed(Feed feed) { + mFeedTitle.setVisibility(VISIBLE); + mFeedTitle.setText(feed.getTitle()); + Glide.with(mContext) + .load(feed.getImageUri()) + .listener(new RequestListener<Uri, GlideDrawable>() { + @Override + public boolean onException(Exception e, Uri model, Target<GlideDrawable> target, boolean isFirstResource) { + return false; + } + + @Override + public boolean onResourceReady(GlideDrawable resource, Uri model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) { + mFeedTitle.setVisibility(INVISIBLE); + return false; + } + }) + .centerCrop() + .into(mImageView); + // Removing the updated time. It could be the latest podcast updated time in the future. + //mTextTime.setText(TimeUtils.getTimeAgo(feed.getLastUpdate().getTime(), mContext)); + mTextTime.setVisibility(GONE); + + // Could be the count of unread/ not played feed items + //mUnreadCountText.setText(String.valueOf(feed.getNumOfItems())); + } + +} diff --git a/app/src/main/res/drawable/cover_image_bg.xml b/app/src/main/res/drawable/cover_image_bg.xml new file mode 100644 index 000000000..cf4c3e9f1 --- /dev/null +++ b/app/src/main/res/drawable/cover_image_bg.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <gradient + android:type="linear" + android:centerX="69%" + android:startColor="#00000000" + android:centerColor="#59000000" + android:endColor="#FF242424" + android:angle="270"/> +</shape>
\ No newline at end of file diff --git a/app/src/main/res/drawable/unread_circle.xml b/app/src/main/res/drawable/unread_circle.xml new file mode 100644 index 000000000..c31e753b1 --- /dev/null +++ b/app/src/main/res/drawable/unread_circle.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="oval"> + + + <stroke + android:width="1dp" + android:color="@color/white"/> + +</shape>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_subscriptions.xml b/app/src/main/res/layout/fragment_subscriptions.xml new file mode 100644 index 000000000..8a61e5fa5 --- /dev/null +++ b/app/src/main/res/layout/fragment_subscriptions.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <GridView + android:id="@+id/subscriptions_grid" + android:layout_width="match_parent" + android:numColumns="3" + android:horizontalSpacing="2dp" + android:verticalSpacing="2dp" + android:layout_height="match_parent" + android:layout_gravity="center_horizontal"> + </GridView> +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/subscription_item.xml b/app/src/main/res/layout/subscription_item.xml new file mode 100644 index 000000000..fc89ab74d --- /dev/null +++ b/app/src/main/res/layout/subscription_item.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + + <de.danoeh.antennapod.view.SubscriptionViewItem + android:layout_width="match_parent" + android:id="@+id/subscription_item" + android:layout_height="match_parent"/> + +</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/subscription_view.xml b/app/src/main/res/layout/subscription_view.xml new file mode 100644 index 000000000..6eb6ba094 --- /dev/null +++ b/app/src/main/res/layout/subscription_view.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <ImageView + android:id="@+id/imgvCover" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + tools:src="@drawable/ic_launcher" /> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/cover_image_bg"> + + <TextView + android:id="@+id/txtvTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:layout_margin="@dimen/widget_margin" + android:ellipsize="end" + android:padding="@dimen/widget_margin" + style="@style/AntennaPod.TextView.Heading" + android:textSize="15sp" + android:textStyle="bold" + tools:text="@string/app_name" /> + + </RelativeLayout> + + <TextView + android:id="@+id/txtvTime" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" + android:layout_margin="@dimen/widget_margin" + android:ellipsize="end" + android:maxLines="1" + android:textColor="@color/white" + android:textSize="12sp" + tools:text="@string/app_name" /> + + <RelativeLayout + android:layout_width="18dp" + android:layout_height="18dp" + android:layout_alignParentBottom="true" + android:layout_margin="5dp" + android:visibility="gone" + android:background="@drawable/unread_circle"> + + <TextView + android:id="@+id/unread_count_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_centerInParent="true" + android:ellipsize="end" + android:maxLines="1" + android:text="0" + android:textColor="@color/white" + android:textSize="11sp" /> + + </RelativeLayout> + + +</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 000000000..9c055f887 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="time_just_now">just now</string> + <string name="time_a_min_ago">a min ago</string> + <string name="time_an_hour_ago">an hour ago</string> + <string name="time_min_ago">" min ago"</string> + <string name="time_yesterday">yesterday</string> + <string name="time_hours_ago">" hours ago"</string> + <string name="time_days_ago">" days ago"</string> +</resources>
\ No newline at end of file |