summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorArtur Dryomov <artur.dryomov@gmail.com>2013-10-25 15:24:02 +0300
committerArtur Dryomov <artur.dryomov@gmail.com>2013-10-25 15:39:39 +0300
commit16c53fb6aa50a8e433bced25d1361a6bcaeb51a8 (patch)
treef03d9b0ec8bd0a53d356f525e9d61772b56ce096 /android
parent2e605fcb12556dd65b0e5e4a0eac25b71182eb7b (diff)
Add "learn more" link for providing additional information.
Change-Id: I3bb3480491d5f92ed7c4e3e6b5cf233636c4bb64
Diffstat (limited to 'android')
-rw-r--r--android/sdremote/AndroidManifest.xml7
-rw-r--r--android/sdremote/res/layout/fragment_computers_list.xml9
-rw-r--r--android/sdremote/res/values/dimens.xml1
-rw-r--r--android/sdremote/res/values/strings.xml2
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java19
5 files changed, 37 insertions, 1 deletions
diff --git a/android/sdremote/AndroidManifest.xml b/android/sdremote/AndroidManifest.xml
index 82bf17eb3930..098345064572 100644
--- a/android/sdremote/AndroidManifest.xml
+++ b/android/sdremote/AndroidManifest.xml
@@ -78,6 +78,13 @@
<activity
android:name=".activity.RequirementsActivity"
android:label="@string/title_requirements">
+
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW"/>
+ <data android:scheme="org.libreoffice.impressremote"/>
+ <category android:name="android.intent.category.DEFAULT"/>
+ </intent-filter>
+
</activity>
<activity
diff --git a/android/sdremote/res/layout/fragment_computers_list.xml b/android/sdremote/res/layout/fragment_computers_list.xml
index 03bbbfe44e8f..edc781978dfc 100644
--- a/android/sdremote/res/layout/fragment_computers_list.xml
+++ b/android/sdremote/res/layout/fragment_computers_list.xml
@@ -48,6 +48,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
+ <TextView
+ android:id="@+id/text_learn_more"
+ android:text="@string/message_learn_more"
+ android:layout_gravity="center_horizontal"
+ android:visibility="invisible"
+ android:paddingTop="@dimen/padding_vertical_learn_more"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
</LinearLayout>
<ListView
diff --git a/android/sdremote/res/values/dimens.xml b/android/sdremote/res/values/dimens.xml
index 7e761757f90d..82013fb011ef 100644
--- a/android/sdremote/res/values/dimens.xml
+++ b/android/sdremote/res/values/dimens.xml
@@ -44,6 +44,7 @@
<dimen name="padding_vertical_error_message">12dp</dimen>
<dimen name="padding_vertical_edit">8dp</dimen>
<dimen name="padding_vertical_progress_message">8dp</dimen>
+ <dimen name="padding_vertical_learn_more">4dp</dimen>
<dimen name="margin_vertical_action_bar_divider">12dp</dimen>
<dimen name="margin_slide">8dp</dimen>
diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml
index fb31b46978e8..4ec816af049b 100644
--- a/android/sdremote/res/values/strings.xml
+++ b/android/sdremote/res/values/strings.xml
@@ -59,9 +59,9 @@
<string name="message_time_is_up">Time is up!</string>
<string name="message_search_wifi">Make sure LibreOffice is running on a computer on the same WiFi network.</string>
<string name="message_search_bluetooth">Make sure LibreOffice is running on a computer with Bluetooth enabled.</string>
+ <string name="message_learn_more"><a href="org.libreoffice.impressremote://requirements/">Learn more</a></string>
<string name="message_paused">Paused</string>
<string name="message_notes_empty">Nothing here.</string>
-
<string name="hint_ip_address">IP address</string>
<string name="hint_name">Name (optional)</string>
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
index 5527ea4d61c4..19657cd0f09b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
@@ -23,7 +23,10 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
+import android.text.Html;
import android.text.TextUtils;
+import android.text.method.LinkMovementMethod;
+import android.text.util.Linkify;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.View;
@@ -107,6 +110,7 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
if (aProgressMessageDisplayed) {
showProgressMessage();
+ showLearnMoreMessage();
}
}
@@ -124,6 +128,20 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
return (TextView) getView().findViewById(R.id.text_progress_message);
}
+ private void showLearnMoreMessage() {
+ TextView learnMoreView = getLearnMoreView();
+ Animation aFadeInAnimation = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in);
+
+ learnMoreView.setMovementMethod(LinkMovementMethod.getInstance());
+
+ learnMoreView.startAnimation(aFadeInAnimation);
+ learnMoreView.setVisibility(View.VISIBLE);
+ }
+
+ private TextView getLearnMoreView() {
+ return (TextView) getView().findViewById(R.id.text_learn_more);
+ }
+
private String getProgressMessage() {
switch (getType()) {
case WIFI:
@@ -238,6 +256,7 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
}
showProgressMessage();
+ showLearnMoreMessage();
}
private boolean isShowingProgressMessageRequired() {