Android v3.0. Redesign comments, bigger icons, redrawn icons, and adding location to comments.
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.newsblur"
|
||||
android:versionCode="43"
|
||||
android:versionName="2.5.0" >
|
||||
android:versionCode="44"
|
||||
android:versionName="3.0.0" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
|
|
BIN
clients/android/NewsBlur/res/drawable-hdpi/clock.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
BIN
clients/android/NewsBlur/res/drawable-hdpi/share_icon.png
Normal file
After Width: | Height: | Size: 820 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 517 B After Width: | Height: | Size: 517 B |
|
@ -105,6 +105,18 @@
|
|||
android:textColor="@color/darkgray"
|
||||
android:textSize="14dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/comment_location"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/comment_text"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_toRightOf="@id/comment_user_image"
|
||||
android:textColor="@color/lightgray"
|
||||
android:textSize="12dp"
|
||||
/>
|
||||
|
||||
<com.newsblur.view.FlowLayout
|
||||
xmlns:newsblur="http://schemas.android.com/apk/res/com.newsblur"
|
||||
android:id="@+id/comment_favourite_avatars"
|
||||
|
@ -121,6 +133,7 @@
|
|||
|
||||
<LinearLayout
|
||||
android:id="@+id/comment_replies_container"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
@ -129,6 +142,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#A6A6A6" />
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
</LinearLayout>
|
|
@ -5,7 +5,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="15dp" >
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/share_story_button"
|
||||
|
@ -20,7 +21,7 @@
|
|||
android:paddingBottom="6dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
android:drawableLeft="@drawable/share_half"
|
||||
android:drawableLeft="@drawable/share_icon"
|
||||
android:text="@string/share_this" />
|
||||
|
||||
<Button
|
||||
|
@ -36,7 +37,7 @@
|
|||
android:paddingBottom="6dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
android:drawableLeft="@drawable/clock_half"
|
||||
android:drawableLeft="@drawable/clock"
|
||||
android:text="@string/save_this" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -45,50 +46,102 @@
|
|||
android:id="@+id/reading_shared_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginBottom="50dp" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/reading_friend_comment_container"
|
||||
android:id="@+id/reading_friend_comment_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/reading_friend_header_top_border"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@color/lightgray"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
android:textColor="@color/darkgray"
|
||||
android:id="@+id/reading_friend_comment_total"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:textStyle="bold"
|
||||
android:paddingBottom="3dp" />
|
||||
android:textSize="10sp"
|
||||
android:background="@drawable/gradient_background_default"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/reading_friend_header_bottom_border"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_below="@id/reading_friend_comment_total"
|
||||
android:background="@color/lightgray"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/comment_divider"
|
||||
<LinearLayout
|
||||
android:id="@+id/reading_friend_comment_container"
|
||||
android:layout_below="@id/reading_friend_comment_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:layout_below="@id/reading_friend_comment_container"
|
||||
android:background="@drawable/divider_light" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/reading_public_comment_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/comment_divider"
|
||||
android:visibility="gone"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/reading_public_header_top_border"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@color/lightgray"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/darkgray"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:textStyle="bold"
|
||||
android:textSize="10sp"
|
||||
android:background="@drawable/gradient_background_default"
|
||||
android:id="@+id/reading_public_comment_total" />
|
||||
|
||||
<View
|
||||
android:id="@+id/reading_public_header_bottom_border"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_below="@id/reading_public_comment_total"
|
||||
android:background="@color/lightgray"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/reading_public_comment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/comment_divider"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_below="@id/reading_public_comment_header"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/darkgray"
|
||||
android:paddingTop="3dp"
|
||||
android:textStyle="bold"
|
||||
android:id="@+id/reading_public_comment_total"
|
||||
android:paddingBottom="3dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -11,7 +11,7 @@ public class BlurDatabase extends SQLiteOpenHelper {
|
|||
private final String TEXT = " text";
|
||||
private final String INTEGER = " integer";
|
||||
public final static String DB_NAME = "blur.db";
|
||||
private final static int VERSION = 1;
|
||||
private final static int VERSION = 2;
|
||||
|
||||
public BlurDatabase(Context context) {
|
||||
super(context, DB_NAME, null, VERSION);
|
||||
|
@ -44,7 +44,8 @@ public class BlurDatabase extends SQLiteOpenHelper {
|
|||
private final String USER_SQL = "CREATE TABLE " + DatabaseConstants.USER_TABLE + " (" +
|
||||
DatabaseConstants.USER_PHOTO_URL + TEXT + ", " +
|
||||
DatabaseConstants.USER_USERID + INTEGER + " PRIMARY KEY, " +
|
||||
DatabaseConstants.USER_USERNAME + TEXT + ")";
|
||||
DatabaseConstants.USER_USERNAME + TEXT + ", " +
|
||||
DatabaseConstants.USER_LOCATION + TEXT + ")";
|
||||
|
||||
private final String SOCIAL_FEED_SQL = "CREATE TABLE " + DatabaseConstants.SOCIALFEED_TABLE + " (" +
|
||||
DatabaseConstants.SOCIAL_FEED_ID + INTEGER + " PRIMARY KEY, " +
|
||||
|
|
|
@ -67,6 +67,7 @@ public class DatabaseConstants {
|
|||
public static final String USER_TABLE = "user_table";
|
||||
public static final String USER_USERID = BaseColumns._ID;
|
||||
public static final String USER_USERNAME = "username";
|
||||
public static final String USER_LOCATION = "location";
|
||||
public static final String USER_PHOTO_URL = "photo_url";
|
||||
|
||||
public static final String STORY_TABLE = "stories";
|
||||
|
|
|
@ -17,6 +17,7 @@ public class UserProfile {
|
|||
public String userId;
|
||||
|
||||
public String username;
|
||||
public String location;
|
||||
|
||||
public static UserProfile fromCursor(final Cursor c) {
|
||||
if (c.isBeforeFirst()) {
|
||||
|
@ -27,6 +28,7 @@ public class UserProfile {
|
|||
profile.userId = c.getString(c.getColumnIndex(DatabaseConstants.USER_USERID));
|
||||
profile.photoUrl = c.getString(c.getColumnIndex(DatabaseConstants.USER_PHOTO_URL));
|
||||
profile.username = c.getString(c.getColumnIndex(DatabaseConstants.USER_USERNAME));
|
||||
profile.location = c.getString(c.getColumnIndex(DatabaseConstants.USER_LOCATION));
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
@ -36,6 +38,7 @@ public class UserProfile {
|
|||
values.put(DatabaseConstants.USER_PHOTO_URL, photoUrl);
|
||||
values.put(DatabaseConstants.USER_USERID, userId);
|
||||
values.put(DatabaseConstants.USER_USERNAME, username);
|
||||
values.put(DatabaseConstants.USER_LOCATION, location);
|
||||
return values;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import android.graphics.Color;
|
|||
import android.graphics.drawable.TransitionDrawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.ScaleDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
@ -170,7 +171,6 @@ public class ReadingItemFragment extends Fragment implements ClassifierDialogFra
|
|||
}
|
||||
|
||||
private void setupSaveButton() {
|
||||
|
||||
Button saveButton = (Button) view.findViewById(R.id.save_story_button);
|
||||
|
||||
saveButton.setOnClickListener(new OnClickListener() {
|
||||
|
@ -413,6 +413,13 @@ public class ReadingItemFragment extends Fragment implements ClassifierDialogFra
|
|||
commentText.setTag("commentBy" + user.id);
|
||||
commentText.setText(sharedText);
|
||||
|
||||
TextView commentLocation = (TextView) commentView.findViewById(R.id.comment_location);
|
||||
if (!TextUtils.isEmpty(user.location)) {
|
||||
commentLocation.setText(user.location.toUpperCase());
|
||||
} else {
|
||||
commentLocation.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (PrefsUtils.getUserImage(getActivity()) != null) {
|
||||
ImageView commentImage = (ImageView) commentView.findViewById(R.id.comment_user_image);
|
||||
commentImage.setImageBitmap(UIUtils.roundCorners(PrefsUtils.getUserImage(getActivity()), 10f));
|
||||
|
|
|
@ -87,7 +87,7 @@ public class SetupCommentSectionTask extends AsyncTask<Void, Void, Void> {
|
|||
ImageView commentImage = (ImageView) commentView.findViewById(R.id.comment_user_image);
|
||||
|
||||
TextView commentSharedDate = (TextView) commentView.findViewById(R.id.comment_shareddate);
|
||||
commentSharedDate.setText(comment.sharedDate.toUpperCase() + " AGO");
|
||||
commentSharedDate.setText(comment.sharedDate + " ago");
|
||||
commentSharedDate.setTag(COMMENT_DATE_BY + comment.userId);
|
||||
|
||||
final FlowLayout favouriteContainer = (FlowLayout) commentView.findViewById(R.id.comment_favourite_avatars);
|
||||
|
@ -167,7 +167,7 @@ public class SetupCommentSectionTask extends AsyncTask<Void, Void, Void> {
|
|||
}
|
||||
|
||||
TextView replySharedDate = (TextView) replyView.findViewById(R.id.reply_shareddate);
|
||||
replySharedDate.setText(reply.shortDate.toUpperCase() + " AGO");
|
||||
replySharedDate.setText(reply.shortDate + " ago");
|
||||
|
||||
((LinearLayout) commentView.findViewById(R.id.comment_replies_container)).addView(replyView);
|
||||
}
|
||||
|
@ -179,6 +179,13 @@ public class SetupCommentSectionTask extends AsyncTask<Void, Void, Void> {
|
|||
commentUsername.setText(commentUser.username);
|
||||
String userPhoto = commentUser.photoUrl;
|
||||
|
||||
TextView commentLocation = (TextView) commentView.findViewById(R.id.comment_location);
|
||||
if (!TextUtils.isEmpty(commentUser.location)) {
|
||||
commentLocation.setText(commentUser.location.toUpperCase());
|
||||
} else {
|
||||
commentLocation.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(comment.sourceUserId)) {
|
||||
commentImage.setVisibility(View.INVISIBLE);
|
||||
ImageView usershareImage = (ImageView) commentView.findViewById(R.id.comment_user_reshare_image);
|
||||
|
@ -270,6 +277,7 @@ public class SetupCommentSectionTask extends AsyncTask<Void, Void, Void> {
|
|||
commentCount = commentCount.substring(0, commentCount.length() - 1);
|
||||
}
|
||||
publicCommentTotal.setText(String.format(commentCount, publicCommentViews.size()));
|
||||
viewHolder.get().findViewById(R.id.reading_public_comment_header).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (friendCommentViews.size() > 0) {
|
||||
|
@ -278,6 +286,7 @@ public class SetupCommentSectionTask extends AsyncTask<Void, Void, Void> {
|
|||
commentCount = commentCount.substring(0, commentCount.length() - 1);
|
||||
}
|
||||
friendCommentTotal.setText(String.format(commentCount, friendCommentViews.size()));
|
||||
viewHolder.get().findViewById(R.id.reading_friend_comment_header).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
for (int i = 0; i < publicCommentViews.size(); i++) {
|
||||
|
|