Skip to content

Commit

Permalink
Merge pull request #18 from rapidpro/hotfix/2.5.0
Browse files Browse the repository at this point in the history
User experience updates
  • Loading branch information
johncordeiro authored Nov 22, 2016
2 parents 90184f2 + 00f8a35 commit e365c2e
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ android {
applicationId "in.ureport"
minSdkVersion 10
targetSdkVersion 23
versionCode 38
versionName "2.4.0"
versionCode 39
versionName "2.5.0"
multiDexEnabled true
}
buildTypes {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/in/ureport/fragments/StoryViewFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SimpleItemAnimator;
import android.support.v7.widget.Toolbar;
import android.text.method.LinkMovementMethod;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
Expand Down Expand Up @@ -225,6 +226,7 @@ private void setupView(View view) {
title.setText(story.getTitle());

TextView content = (TextView) view.findViewById(R.id.content);
content.setMovementMethod(LinkMovementMethod.getInstance());
content.setText(story.getContent());

scrollView = (NestedScrollView) view.findViewById(R.id.scrollView);
Expand Down
24 changes: 13 additions & 11 deletions app/src/main/java/in/ureport/managers/FirebaseManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@ public class FirebaseManager {
private static Firebase reference;

public static void init(Context context, boolean proxyEnabled) {
Firebase.setAndroidContext(context);
if (reference == null) {
Firebase.setAndroidContext(context);

Config config = new Config();
config.setLogLevel(Logger.Level.DEBUG);
config.setPersistenceEnabled(true);
if (proxyEnabled) {
config.setAuthenticationServer(context.getString(R.string.firebase_proxy_auth));
}
Firebase.setDefaultConfig(config);

Config config = new Config();
config.setLogLevel(Logger.Level.DEBUG);
config.setPersistenceEnabled(true);
if (proxyEnabled) {
config.setAuthenticationServer(context.getString(R.string.firebase_proxy_auth));
String appUrl = proxyEnabled
? context.getString(R.string.firebase_proxy_database) : context.getString(R.string.firebase_app);
reference = getInstanceWithCustomName(appUrl, context.getString(R.string.firebase_app_name));
}
Firebase.setDefaultConfig(config);

String appUrl = proxyEnabled
? context.getString(R.string.firebase_proxy_database) : context.getString(R.string.firebase_app);
reference = getInstanceWithCustomName(appUrl, context.getString(R.string.firebase_app_name));
}

private static Firebase getInstanceWithCustomName(String url, String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.RecyclerView;
import android.text.method.LinkMovementMethod;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MenuItem;
Expand Down Expand Up @@ -89,6 +90,7 @@ public ItemViewHolder(View itemView) {

picture = (ImageView) itemView.findViewById(R.id.picture);
contribution = (TextView) itemView.findViewById(R.id.contribution);
contribution.setMovementMethod(LinkMovementMethod.getInstance());
author = (TextView) itemView.findViewById(R.id.tags);
date = (TextView) itemView.findViewById(R.id.date);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.support.annotation.IdRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.text.method.LinkMovementMethod;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -93,6 +94,7 @@ public void bindView(User user, ChatMessage chatMessage) {
bindMedia(user, chatMessage);
} else {
message = (TextView) findIfNeeded(message, R.id.chatMessage);
message.setMovementMethod(LinkMovementMethod.getInstance());
message.setText(chatMessage.getMessage());
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/item_chat_message_text.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:autoLink="web"
tools:text="Mensagem do chat, testando" />

<TextView
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/item_contribution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
android:layout_marginStart="10dp"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:autoLink="web"
android:gravity="center_vertical|start"
android:textColor="@android:color/black"
android:textAlignment="viewStart"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/view_story_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
android:gravity="start"
android:ellipsize="end"
android:textSize="17sp"
android:autoLink="web"
tools:text="Boosting community development, disease control with sms-based platform" />

<LinearLayout
Expand Down

0 comments on commit e365c2e

Please sign in to comment.