summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2014-11-17 13:10:20 +0100
committerArne Schwabe <arne@rfc2549.org>2014-11-17 13:10:20 +0100
commitc67a5e6a846fa55b94cecacf08c489bbbaa7576c (patch)
treec7c61baee8f8e3fc6762884e74d0af3df72a01d5 /main/src
parent16d429817229153e1edf8f9b06a49502ea234a4c (diff)
Do not resize RecyclerView since it crashes
--HG-- extra : rebase_source : d2065a08f5fdc69ac2fd5140d28c4ea52b2a47e0
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/ConnectionsAdapter.java2
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/Settings_Connections.java3
-rw-r--r--main/src/main/res/layout/connections.xml31
-rw-r--r--main/src/main/res/layout/log_fragment.xml4
4 files changed, 20 insertions, 20 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/ConnectionsAdapter.java b/main/src/main/java/de/blinkt/openvpn/fragments/ConnectionsAdapter.java
index 94247fab..05adef0d 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/ConnectionsAdapter.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/ConnectionsAdapter.java
@@ -159,7 +159,7 @@ public class ConnectionsAdapter extends RecyclerView.Adapter<ConnectionsAdapter.
return mConnections.length;
}
- private void displayWarningifNoneEnabled()
+ public void displayWarningifNoneEnabled()
{
int showWarning = View.VISIBLE;
for(Connection conn:mConnections) {
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Connections.java b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Connections.java
index 60008136..db620c52 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Connections.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Connections.java
@@ -70,9 +70,12 @@ public class Settings_Connections extends Fragment implements View.OnClickListen
mConnectionsAdapter = new ConnectionsAdapter(getActivity(), this, mProfile);
//mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(columns, StaggeredGridLayoutManager.VERTICAL));
+ mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
mRecyclerView.setAdapter(mConnectionsAdapter);
+ mConnectionsAdapter.displayWarningifNoneEnabled();
+
ImageButton fab_button = (ImageButton) v.findViewById(R.id.add_new_remote);
if(fab_button!=null)
fab_button.setOnClickListener(this);
diff --git a/main/src/main/res/layout/connections.xml b/main/src/main/res/layout/connections.xml
index 1c44d498..011d3472 100644
--- a/main/src/main/res/layout/connections.xml
+++ b/main/src/main/res/layout/connections.xml
@@ -12,25 +12,10 @@
- <TextView
- android:id="@+id/noserver_active_warning"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="10dp"
- android:background="@drawable/white_rect"
- android:drawableLeft="@drawable/ic_dialog_alert"
- android:drawablePadding="10dp"
- android:elevation="10dp"
- android:gravity="center_vertical"
- android:padding="@dimen/stdpadding"
- android:text="You need to enable at least one server."
- android:visibility="visible"
- tools:visibility="visible" />
<CheckBox
android:text="Use connection entries in random order on connect"
android:id="@+id/remote_random"
- android:layout_below="@id/noserver_active_warning"
android:padding="@dimen/stdpadding"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
@@ -44,6 +29,22 @@
android:horizontalSpacing="@dimen/stdpadding"
/>
+
+ <TextView
+ android:id="@+id/noserver_active_warning"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="10dp"
+ android:background="@drawable/white_rect"
+ android:drawableLeft="@drawable/ic_dialog_alert"
+ android:drawablePadding="10dp"
+ android:elevation="2dp"
+ android:gravity="center_vertical"
+ android:padding="@dimen/stdpadding"
+ android:text="You need to enable at least one server."
+ android:visibility="visible"
+ tools:visibility="visible" />
+
<include layout="@layout/connection_fab" />
</RelativeLayout> \ No newline at end of file
diff --git a/main/src/main/res/layout/log_fragment.xml b/main/src/main/res/layout/log_fragment.xml
index 6271ef1b..4fec942e 100644
--- a/main/src/main/res/layout/log_fragment.xml
+++ b/main/src/main/res/layout/log_fragment.xml
@@ -27,10 +27,6 @@
android:layout_height="wrap_content"/>
</LinearLayout>
-
-
-
-
<ListView
android:id="@android:id/list"
android:transcriptMode="normal"