diff --git a/app/build.gradle b/app/build.gradle index cb4167b..cd5ec12 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 { diff --git a/app/src/main/java/in/ureport/fragments/StoryViewFragment.java b/app/src/main/java/in/ureport/fragments/StoryViewFragment.java index 7ad9c89..6230387 100644 --- a/app/src/main/java/in/ureport/fragments/StoryViewFragment.java +++ b/app/src/main/java/in/ureport/fragments/StoryViewFragment.java @@ -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; @@ -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); diff --git a/app/src/main/java/in/ureport/managers/FirebaseManager.java b/app/src/main/java/in/ureport/managers/FirebaseManager.java index aee3225..19d7be7 100644 --- a/app/src/main/java/in/ureport/managers/FirebaseManager.java +++ b/app/src/main/java/in/ureport/managers/FirebaseManager.java @@ -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) { diff --git a/app/src/main/java/in/ureport/views/adapters/ContributionAdapter.java b/app/src/main/java/in/ureport/views/adapters/ContributionAdapter.java index e550da1..0d8ade9 100644 --- a/app/src/main/java/in/ureport/views/adapters/ContributionAdapter.java +++ b/app/src/main/java/in/ureport/views/adapters/ContributionAdapter.java @@ -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; @@ -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); diff --git a/app/src/main/java/in/ureport/views/holders/ChatMessageViewHolder.java b/app/src/main/java/in/ureport/views/holders/ChatMessageViewHolder.java index 7c576d4..1e050f2 100644 --- a/app/src/main/java/in/ureport/views/holders/ChatMessageViewHolder.java +++ b/app/src/main/java/in/ureport/views/holders/ChatMessageViewHolder.java @@ -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; @@ -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()); } diff --git a/app/src/main/res/layout/item_chat_message_text.xml b/app/src/main/res/layout/item_chat_message_text.xml index 3462091..0bee82f 100644 --- a/app/src/main/res/layout/item_chat_message_text.xml +++ b/app/src/main/res/layout/item_chat_message_text.xml @@ -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" />