diff options
author | Arne Schwabe <arne@rfc2549.org> | 2013-09-27 22:57:30 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2013-09-27 22:57:30 +0200 |
commit | 911f3855f184ecdb1339c1d8383ea19e86fe918e (patch) | |
tree | 8799a9b78e0a7f5c7e4162a410ce256135f535f4 /src/de/blinkt/openvpn/LogDetailActionProvider.java | |
parent | 4d9f6e5358b97ab104bc6c26b862ab290161568f (diff) |
Implement changing log level on the fly in the log window, still needs some UI design love
--HG--
extra : rebase_source : 207343cea3b74cd07ebdf00f8ef443465d12c966
Diffstat (limited to 'src/de/blinkt/openvpn/LogDetailActionProvider.java')
-rw-r--r-- | src/de/blinkt/openvpn/LogDetailActionProvider.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/LogDetailActionProvider.java b/src/de/blinkt/openvpn/LogDetailActionProvider.java new file mode 100644 index 00000000..697d5b3a --- /dev/null +++ b/src/de/blinkt/openvpn/LogDetailActionProvider.java @@ -0,0 +1,61 @@ +package de.blinkt.openvpn; + +import android.annotation.TargetApi; +import android.app.ActionBar; +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.*; +import android.widget.SpinnerAdapter; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Created by arne on 22.09.13. + */ +public class LogDetailActionProvider extends ActionProvider { + /** + * Creates a new instance. ActionProvider classes should always implement a + * constructor that takes a single Context parameter for inflating from menu XML. + * + * @param context Context for accessing resources. + */ + public LogDetailActionProvider(Context context) { + super(context); + } + + @Override + public View onCreateActionView() { + return null; + } + + @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + @Override + public View onCreateActionView(MenuItem forItem) { + return super.onCreateActionView(forItem); + } + + @Override + public boolean hasSubMenu() { + return true; + } + + @Override + public void onPrepareSubMenu(SubMenu subMenu) { + subMenu.add(1, Menu.NONE, Menu.NONE, "one"); + subMenu.add(1, Menu.NONE, Menu.NONE, "two"); + subMenu.add(1, Menu.NONE, Menu.NONE, "three"); + subMenu.add(1, Menu.NONE, Menu.NONE, "four"); + + subMenu.add(2, Menu.NONE, Menu.NONE, "no"); + subMenu.add(2, Menu.NONE, Menu.NONE, "short"); + subMenu.add(2, Menu.NONE, Menu.NONE, "long"); + + + } + + @Override + public boolean onPerformDefaultAction() { + return super.onPerformDefaultAction(); + } +}
\ No newline at end of file |