[npr-android-app] push by adamwbr...@gmail.com - - Replaced ... with ellipsis character in Strings (Android Lint... on 2012-05-01 01:44 GMT

134 views
Skip to first unread message

npr-and...@googlecode.com

unread,
Apr 30, 2012, 9:45:07 PM4/30/12
to npr-a...@googlegroups.com
Revision: 6bd13e78cf29
Author: Adam Brown <adamw...@gmail.com>
Date: Mon Apr 30 18:44:34 2012
Log: - Replaced ... with ellipsis character in Strings (Android Lint
complains)
- Replaced Notification.Builder with manual Notification construction
(for backwards compatibility pre API 11)
- Reverted From MATCH_PARENT to FILL_PARENT for API 7 compatibility
- Replaced Menu icon graphics with the asset from ticket #140 (made the
pressed version my self by inverting colors)
- Made Nav Menu button background transparent
- Fixed potential bug where view.setBackgroundColor() expected fully
resolved Color resource, but was instead given a resource ID
http://code.google.com/p/npr-android-app/source/detail?r=6bd13e78cf29

Modified:
/Npr/res/drawable-hdpi/navigation_icon_normal.png
/Npr/res/drawable-hdpi/navigation_icon_pressed.png
/Npr/res/layout/main.xml
/Npr/res/values/strings.xml
/Npr/src/org/npr/android/news/BannerView.java
/Npr/src/org/npr/android/news/NewsStoryActivity.java
/Npr/src/org/npr/android/news/PlaybackService.java
/Npr/src/org/npr/android/news/PlaylistAdapter.java
/Npr/src/org/npr/android/news/PlaylistView.java
/Npr/src/org/npr/android/news/RootActivity.java

=======================================
--- /Npr/res/drawable-hdpi/navigation_icon_normal.png Wed Apr 25 17:57:30
2012
+++ /Npr/res/drawable-hdpi/navigation_icon_normal.png Mon Apr 30 18:44:34
2012
Binary file, no diff available.
=======================================
--- /Npr/res/drawable-hdpi/navigation_icon_pressed.png Wed Apr 25 17:57:30
2012
+++ /Npr/res/drawable-hdpi/navigation_icon_pressed.png Mon Apr 30 18:44:34
2012
Binary file, no diff available.
=======================================
--- /Npr/res/layout/main.xml Wed Apr 25 17:57:30 2012
+++ /Npr/res/layout/main.xml Mon Apr 30 18:44:34 2012
@@ -26,7 +26,7 @@
android:id="@+id/MainNavButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/navigation_button" />
+ android:src="@drawable/navigation_button"
android:background="@android:color/transparent"/>

<ImageView
android:layout_height="wrap_content"
=======================================
--- /Npr/res/values/strings.xml Thu Jan 19 16:32:00 2012
+++ /Npr/res/values/strings.xml Mon Apr 30 18:44:34 2012
@@ -2,7 +2,7 @@
<resources>
<string name="app_name">NPR News</string>

- <string name="msg_load_more">Load more stories...</string>
+ <string name="msg_load_more">Load more stories…</string>

<string name="msg_refresh">Refresh</string>

=======================================
--- /Npr/src/org/npr/android/news/BannerView.java Wed Apr 25 17:57:30 2012
+++ /Npr/src/org/npr/android/news/BannerView.java Mon Apr 30 18:44:34 2012
@@ -230,7 +230,7 @@
TextView left = new TextView(context);
LayoutParams textLayout = new LayoutParams(
dim53,
- LayoutParams.MATCH_PARENT,
+ LayoutParams.FILL_PARENT,
1
);
textLayout.gravity = Gravity.CENTER;
=======================================
--- /Npr/src/org/npr/android/news/NewsStoryActivity.java Wed Apr 25
17:02:51 2012
+++ /Npr/src/org/npr/android/news/NewsStoryActivity.java Mon Apr 30
18:44:34 2012
@@ -111,8 +111,8 @@
inflater = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);

FrameLayout.LayoutParams layout = new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT
+ FrameLayout.LayoutParams.FILL_PARENT,
+ FrameLayout.LayoutParams.FILL_PARENT
);
layout.setMargins(0, 0, 0, DisplayUtils.convertToDIP(this, 95));
((ViewGroup) findViewById(R.id.TitleContent)).addView(workspace,
layout);
=======================================
--- /Npr/src/org/npr/android/news/PlaybackService.java Wed Apr 25 17:02:51
2012
+++ /Npr/src/org/npr/android/news/PlaybackService.java Mon Apr 30 18:44:34
2012
@@ -471,6 +471,14 @@
private void presentPlayingNotification()
{
CharSequence contentText = currentPlayable.getTitle();
+ Notification notification =
+ new Notification(R.drawable.stat_notify_musicplayer,
+ contentText,
+ System.currentTimeMillis());
+ notification.flags = Notification.FLAG_NO_CLEAR
+ | Notification.FLAG_ONGOING_EVENT;
+ Context context = getApplicationContext();
+ CharSequence title = getString(R.string.app_name);

Class<?> notificationActivity;
if (currentPlayable.getActivityName() != null) {
@@ -482,33 +490,19 @@
} else {
notificationActivity = NewsListActivity.class;
}
-
- Context context = getApplicationContext();
- CharSequence title = getString(R.string.app_name);
- Intent notificationIntent;
+ Intent notificationIntent = new Intent(this, notificationActivity);
if (currentPlayable.getActivityData() != null) {
- notificationIntent = new Intent(this, notificationActivity);
notificationIntent.putExtra(Constants.EXTRA_ACTIVITY_DATA,
currentPlayable.getActivityData());
notificationIntent.putExtra(Constants.EXTRA_DESCRIPTION,
R.string.msg_main_subactivity_nowplaying);
- } else {
- notificationIntent = new Intent(this, NewsListActivity.class);
}
notificationIntent.setAction(Intent.ACTION_VIEW);
notificationIntent.addCategory(Intent.CATEGORY_DEFAULT);
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
-
- Notification.Builder notBuilder = new Notification.Builder(this);
- notBuilder.setSmallIcon(R.drawable.stat_notify_musicplayer);
- notBuilder.setContentTitle(title);
- notBuilder.setContentText(contentText);
- notBuilder.setContentIntent(contentIntent);
- notBuilder.setOngoing(true);
- notBuilder.setWhen(System.currentTimeMillis());
- Notification notification = notBuilder.getNotification();
+ notification.setLatestEventInfo(context, title, contentText,
contentIntent);

startForeground(NOTIFICATION_ID, notification);
}
=======================================
--- /Npr/src/org/npr/android/news/PlaylistAdapter.java Wed Apr 25 17:02:51
2012
+++ /Npr/src/org/npr/android/news/PlaylistAdapter.java Mon Apr 30 18:44:34
2012
@@ -63,7 +63,7 @@
playlistItemState.setImageResource(R.drawable.speaker_icon);
} else {
view.setBackgroundDrawable(null);
- view.setBackgroundColor(android.R.color.transparent);
+
view.setBackgroundColor(context.getResources().getColor(android.R.color.transparent));
String isRead = cursor.getString(
cursor.getColumnIndex(PlaylistProvider.Items.IS_READ));
if (isRead.equals("0")) {
=======================================
--- /Npr/src/org/npr/android/news/PlaylistView.java Wed Apr 25 17:57:30 2012
+++ /Npr/src/org/npr/android/news/PlaylistView.java Mon Apr 30 18:44:34 2012
@@ -567,7 +567,7 @@

@Override
public void onDrawerOpened() {
- handle.setLayoutParams(new
LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
+ handle.setLayoutParams(new
LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
DisplayUtils.convertToDIP(context, 150)));
playerContracted.setVisibility(View.GONE);
playerExpanded.setVisibility(View.VISIBLE);
@@ -576,7 +576,7 @@

@Override
public void onDrawerClosed() {
- handle.setLayoutParams(new
LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
+ handle.setLayoutParams(new
LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
DisplayUtils.convertToDIP(context, 95)));
playerContracted.setVisibility(View.VISIBLE);
playerExpanded.setVisibility(View.GONE);
=======================================
--- /Npr/src/org/npr/android/news/RootActivity.java Sat Apr 28 09:55:59 2012
+++ /Npr/src/org/npr/android/news/RootActivity.java Mon Apr 30 18:44:34 2012
@@ -74,8 +74,8 @@
ViewGroup titleFrame = (ViewGroup) findViewById(R.id.TitleContent);
navigationView = new NavigationView(this);
titleFrame.addView(navigationView,
- new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT,
- LayoutParams.MATCH_PARENT));
+ new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT,
+ LayoutParams.FILL_PARENT));
navigationView.setVisibility(View.GONE);

ImageButton mainSearchButton =
@@ -88,8 +88,8 @@

playlistView = new PlaylistView(this);
titleFrame.addView(playlistView,
- new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT,
- LayoutParams.MATCH_PARENT));
+ new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT,
+ LayoutParams.FILL_PARENT));

progressIndicator =
(ProgressBar) findViewById(R.id.WindowProgressIndicator);
Reply all
Reply to author
Forward
0 new messages