diff options
author | Arne Schwabe <arne@rfc2549.org> | 2014-12-01 16:58:39 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2014-12-01 16:58:39 +0100 |
commit | edf90cc5d3ff50d2f27de67d259aeb0759d5fdff (patch) | |
tree | 652f84a4f28d146baad3bbb6e6a85762ff306e4b | |
parent | 764c6125aba7a52154555819c23a97498b79017c (diff) |
Allow log to be opened from main screen, fix FAQ fragment columns calculation
--HG--
extra : rebase_source : cc6101380e693766760dc5ef48519f64c25ebd1a
-rw-r--r-- | main/openvpn/config-version.h | 2 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/activities/MainActivity.java | 20 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/fragments/FaqFragment.java | 10 | ||||
-rw-r--r-- | main/src/main/res/drawable-hdpi/ic_receipt_white_24dp.png | bin | 0 -> 261 bytes | |||
-rw-r--r-- | main/src/main/res/drawable-mdpi/ic_receipt_white_24dp.png | bin | 0 -> 194 bytes | |||
-rw-r--r-- | main/src/main/res/drawable-xhdpi/ic_receipt_white_24dp.png | bin | 0 -> 240 bytes | |||
-rw-r--r-- | main/src/main/res/drawable-xxhdpi/ic_receipt_white_24dp.png | bin | 0 -> 292 bytes | |||
-rw-r--r-- | main/src/main/res/drawable-xxxhdpi/ic_receipt_white_24dp.png | bin | 0 -> 334 bytes | |||
-rw-r--r-- | main/src/main/res/menu/main_menu.xml | 14 | ||||
-rw-r--r-- | main/src/main/res/values-v21/refs.xml | 2 | ||||
-rw-r--r-- | main/src/main/res/values/dimens.xml | 2 | ||||
-rw-r--r-- | main/src/main/res/values/refs.xml | 1 | ||||
-rwxr-xr-x | main/src/main/res/values/strings.xml | 1 |
13 files changed, 45 insertions, 7 deletions
diff --git a/main/openvpn/config-version.h b/main/openvpn/config-version.h index ca6f995f..1b41a56b 100644 --- a/main/openvpn/config-version.h +++ b/main/openvpn/config-version.h @@ -1,2 +1,2 @@ -#define CONFIGURE_GIT_REVISION "icsopenvpn_623-b18153d535847b6d" +#define CONFIGURE_GIT_REVISION "icsopenvpn_623-7119a45a4cbb1778" #define CONFIGURE_GIT_FLAGS "" diff --git a/main/src/main/java/de/blinkt/openvpn/activities/MainActivity.java b/main/src/main/java/de/blinkt/openvpn/activities/MainActivity.java index 66152f66..1554a557 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/MainActivity.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/MainActivity.java @@ -8,17 +8,16 @@ package de.blinkt.openvpn.activities; import android.annotation.TargetApi; import android.app.ActionBar; import android.app.Activity; -import android.app.Fragment; import android.content.Intent; import android.os.Build; -import android.support.annotation.StringRes; import android.support.v4n.view.ViewPager; +import android.view.Menu; +import android.view.MenuItem; import de.blinkt.openvpn.R; import de.blinkt.openvpn.fragments.AboutFragment; import de.blinkt.openvpn.fragments.FaqFragment; import de.blinkt.openvpn.fragments.GeneralSettings; -import de.blinkt.openvpn.fragments.LogFragment; import de.blinkt.openvpn.fragments.SendDumpFragment; import de.blinkt.openvpn.fragments.VPNProfileList; import de.blinkt.openvpn.views.ScreenSlidePagerAdapter; @@ -75,6 +74,21 @@ public class MainActivity extends Activity { @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.main_menu,menu); + return super.onCreateOptionsMenu(menu); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId()==R.id.show_log){ + Intent showLog = new Intent(this, LogWindow.class); + startActivity(showLog); + } + return super.onOptionsItemSelected(item); + } + + @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/FaqFragment.java b/main/src/main/java/de/blinkt/openvpn/fragments/FaqFragment.java index f8e80a4c..05e26104 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/FaqFragment.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/FaqFragment.java @@ -10,6 +10,7 @@ import android.os.Build; import android.os.Bundle; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGridLayoutManager; +import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -42,8 +43,13 @@ private static int[] faqitems[] = Bundle savedInstanceState) { View v= inflater.inflate(R.layout.faq, container, false); - int dpwidth = (int) (container.getWidth()/getResources().getDisplayMetrics().density); - int columns = dpwidth/400; + DisplayMetrics displaymetrics = new DisplayMetrics(); + getActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); + int dpWidth = (int) (displaymetrics.widthPixels /getResources().getDisplayMetrics().density); + + //better way but does not work on 5.0 + //int dpWidth = (int) (container.getWidth()/getResources().getDisplayMetrics().density); + int columns = dpWidth/360; columns = Math.max(1, columns); diff --git a/main/src/main/res/drawable-hdpi/ic_receipt_white_24dp.png b/main/src/main/res/drawable-hdpi/ic_receipt_white_24dp.png Binary files differnew file mode 100644 index 00000000..bf781280 --- /dev/null +++ b/main/src/main/res/drawable-hdpi/ic_receipt_white_24dp.png diff --git a/main/src/main/res/drawable-mdpi/ic_receipt_white_24dp.png b/main/src/main/res/drawable-mdpi/ic_receipt_white_24dp.png Binary files differnew file mode 100644 index 00000000..565c67ff --- /dev/null +++ b/main/src/main/res/drawable-mdpi/ic_receipt_white_24dp.png diff --git a/main/src/main/res/drawable-xhdpi/ic_receipt_white_24dp.png b/main/src/main/res/drawable-xhdpi/ic_receipt_white_24dp.png Binary files differnew file mode 100644 index 00000000..66dafa4f --- /dev/null +++ b/main/src/main/res/drawable-xhdpi/ic_receipt_white_24dp.png diff --git a/main/src/main/res/drawable-xxhdpi/ic_receipt_white_24dp.png b/main/src/main/res/drawable-xxhdpi/ic_receipt_white_24dp.png Binary files differnew file mode 100644 index 00000000..2161c9a5 --- /dev/null +++ b/main/src/main/res/drawable-xxhdpi/ic_receipt_white_24dp.png diff --git a/main/src/main/res/drawable-xxxhdpi/ic_receipt_white_24dp.png b/main/src/main/res/drawable-xxxhdpi/ic_receipt_white_24dp.png Binary files differnew file mode 100644 index 00000000..8cac119c --- /dev/null +++ b/main/src/main/res/drawable-xxxhdpi/ic_receipt_white_24dp.png diff --git a/main/src/main/res/menu/main_menu.xml b/main/src/main/res/menu/main_menu.xml new file mode 100644 index 00000000..3b7479fb --- /dev/null +++ b/main/src/main/res/menu/main_menu.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (c) 2012-2014 Arne Schwabe + ~ Distributed under the GNU GPL v2. For full terms see the file doc/LICENSE.txt + --> + +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/show_log" + android:icon="@drawable/ic_receipt" + android:showAsAction="ifRoom|withText" + android:title="@string/show_log_window" + android:titleCondensed="@string/show_log"/> +</menu>
\ No newline at end of file diff --git a/main/src/main/res/values-v21/refs.xml b/main/src/main/res/values-v21/refs.xml index 44be98e9..94db373d 100644 --- a/main/src/main/res/values-v21/refs.xml +++ b/main/src/main/res/values-v21/refs.xml @@ -20,4 +20,6 @@ <drawable name="ic_dialog_alert">@drawable/ic_warning_black_36dp</drawable> <drawable name="ic_menu_add_grey">@drawable/ic_add_circle_outline_grey600_24dp</drawable> <drawable name="ic_menu_import_grey">@drawable/ic_archive_grey600_24dp</drawable> + <drawable name="ic_receipt">@drawable/ic_receipt_white_24dp</drawable> + </resources>
\ No newline at end of file diff --git a/main/src/main/res/values/dimens.xml b/main/src/main/res/values/dimens.xml index 773635cf..e688289d 100644 --- a/main/src/main/res/values/dimens.xml +++ b/main/src/main/res/values/dimens.xml @@ -17,6 +17,6 @@ <dimen name="round_button_diameter">56dp</dimen> <dimen name="switchbar_pad">16dp</dimen> <dimen name="vpn_setting_padding">16dp</dimen> - + <integer name="num_columns">1</integer> </resources>
\ No newline at end of file diff --git a/main/src/main/res/values/refs.xml b/main/src/main/res/values/refs.xml index 0d2bfce1..479c6ffc 100644 --- a/main/src/main/res/values/refs.xml +++ b/main/src/main/res/values/refs.xml @@ -19,6 +19,7 @@ <drawable name="ic_menu_import_grey">@drawable/ic_menu_archive</drawable> <drawable name="ic_menu_delete_grey">@android:drawable/ic_menu_delete</drawable> <drawable name="ic_menu_copy">@drawable/ic_menu_copy_holo_light</drawable> + <drawable name="ic_receipt">@drawable/ic_receipt_white_24dp</drawable> </resources>
\ No newline at end of file diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index 09fab42f..2f9358bf 100755 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -348,5 +348,6 @@ <string name="no_remote_defined">No remote defined</string> <string name="duplicate_vpn">Duplicate VPN profile</string> <string name="duplicate_profile_title">Duplicating profile: %s</string> + <string name="show_log">Show log</string> </resources> |