[EPD Keyboard] how to make yota 3 epd keyboard - YotaPhone 3 ROMs, Kernels, Recoveries, & Other Dev

you can make any keyboard app to yota 3 epd keyboard
yota 3's epd keyboard condition
- package name include '_epd'
- keyboard service name include '_EPD'
you can modify source or app with apktool
1. select keyboard app you want.
2. from source or apktool decompile
3. add '_epd' to android ackage name (AndroidManifest.xml)
HTML:
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.koreanime">
->
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.koreanime_epd">
4. add '_epd' to all resources and sources
5. add '_EPD' to android keyboard name and intent-filter priority to 100 (Baidu_EPD priority's eat your app)
in AndroidManifest.xml
HTML:
<service android:name="com.koreanime.Keyboard" android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
->
<service android:name="com.koreanime.Keyboard_EPD" android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter android:priority="100">
6. replace service name to new name
after compile and install
you can activate keyboard from setting in EPD
activate settings -> input -> virtual keyboard
select your keyboard and !!!
dialog box only front screen.
select your keyboard from front screen.
you can use your keyboard.
happy reading.

Thanks

Thanks

decompile ok, when insert code recompile error

I've try it for a while and finally I made it!Thank you sooooooooooooooooooo much!!
This is the what I made,a EPD version of Google Pinyin Input.
I'm not a profesional developer so I cannot ensure the stablity.
我试了好久居然成功了!感谢楼主!
这个是我做的谷歌拼音,有需要的可以试试。
不是专业人员,不保证稳定性哈。
【新注册不给发链接……】pan.baidu.com/s/1Ww1Hq-L9mF-oDw_ai_wBiw【new user cannot post outside link...】

Related

[MOD][HOW-TO] Add an item to Settings

You mainly see these kinds of things in AOSP ROMs, but I'll teach you guys how to add a "Tweaks" option to the Settings app. Some people know how to do this, others don't. In the spirit of making a better community, here's the how-to. I'll be using the MIUI batterybar by PvyParts as the example. So, to add the MIUI batterybar to Settings, follow the following steps:
Note: You must have already made your ROM compatible with the batterybar mod for it to work. This guide just teaches you how to add things to it. Also, this guide works only if you have a tweaks app such as the batterybar, quickpanel settings, etc so make sure you have those apps installed.​
[*]Decompile SecSettings.apk (I use Apk Manager)
[*]Navigate to /res/xml/settings_headers.xml
Add
Code:
<header android:title="@string/header_category_rom_mods" />
<header android:icon="@drawable/ic_settings_batterybar" android:id="@id/batterybar_settings" android:title="@string/batterybar_settings">
<intent android:targetPackage="com.pvy.battbar.settings" android:action="android.intent.action.MAIN" android:targetClass="com.pvy.battbar.settings.options" />
</header>
below
Code:
<header android:icon="@drawable/ic_settings_more" android:id="@id/wireless_settings" android:title="@string/more_settings" android:fragment="com.android.settings.WirelessSettings" android:breadCrumbTitle="@string/wireless_networks_settings_title" />
It'll look like this when finished:
Code:
<header android:icon="@drawable/ic_settings_more" android:id="@id/wireless_settings" android:title="@string/more_settings" android:fragment="com.android.settings.WirelessSettings" android:breadCrumbTitle="@string/wireless_networks_settings_title" />
[COLOR="SeaGreen"] <header android:title="@string/header_category_rom_mods" />
<header android:icon="@drawable/ic_settings_batterybar" android:id="@id/batterybar_settings" android:title="@string/batterybar_settings">
<intent android:targetPackage="com.pvy.battbar.settings" android:action="android.intent.action.MAIN" android:targetClass="com.pvy.battbar.settings.options" />
</header>[/COLOR]
[*]Navigate to /res/values/strings.xml
Scroll to the bottom of the file and add
Code:
<string name="header_category_rom_mods">ROM Control</string>
<string name="batterybar_settings">Battery Bar</string>
right above
Code:
</resources>
It'll look like this when finished (You can name "ROM Control" and "Battery Bar" to whatever you want):
Code:
[COLOR="SeaGreen"]<string name="header_category_rom_mods">ROM Control</string>
<string name="batterybar_settings">Battery Bar</string>[/COLOR]
</resources>
[*]Navigate to /res/values/public.xml
This is the tricky part. You will have to assign unique IDs to each mod. Additionally, you will need to assign a "drawable" type (for the picture) and a "string" type (for the name). This is what my code looks like (the red part is the unique ID (you can use mine as long as they don't conflict with any ID in your public.xml)):
At line 797:
Code:
<public type="drawable" name="ic_settings_batterybar" id="[COLOR="Red"]0x7f0203e2[/COLOR]" />
At line 4871:
Code:
<public type="string" name="batterybar_settings" id="0x7f090e3a" />" id="[COLOR="red"]0x7f0203e2[/COLOR]" />
At line 4869:
Code:
<public type="string" name="header_category_rom_mods" id="[COLOR="red"]0x7f090e38[/COLOR]" />
[*]Navigate to /res/values/ids.xml
Scroll to the bottom of the file and add:
Code:
<item type="id" name="batterybar_settings">false</item>
right above
Code:
</resources>
[*]Recompile SecSettings.apk and push it to your phone.
Awesome, great write up!
A little trick I learned that will allow you to not worry about finding a unique ID for res/public is let the system generate one for you
Add your lines to strings first and nothing else, then re-compile. Then immediately decompile the one you just built. Sounds confusing i know, but.........Now when you open up res/public the lines you just added to strings will have automatically populated with thier own unique ID and you never had to do anything. Try it
Much easier than trying to figure out which HEX ID isnt used, whats in range, or whats next.
:good:
Interesting, I used to wonder how you guys add things like that...
Didact74 said:
Awesome, great write up!
A little trick I learned that will allow you to not worry about finding a unique ID for res/public is let the system generate one for you
Add your lines to strings first and nothing else, then re-compile. Then immediately decompile the one you just built. Sounds confusing i know, but.........Now when you open up res/public the lines you just added to strings will have automatically populated with thier own unique ID and you never had to do anything. Try it
Much easier than trying to figure out which HEX ID isnt used, whats in range, or whats next.
:good:
Click to expand...
Click to collapse
So you're saying do step three first, then step two and then step 4?
Sent from my SCH-I535 using xda app-developers app
Twisted politiks said:
So you're saying do step three first, then step two and then step 4?
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
Crap, I am sorry if it was confusing. I didn't want to muddle up PM's thread. I would stick to his instructions if you don't quite follow what I was saying. It was meant for those that spend a lot of time running through code. Basically you can skip the part of adding IDs to res/public because once you add your info to strings the recompile process auto generates the IDs for you.
If this confuses you just stick to PMs instructions. : )
收件人: [MOD][HOW-TO] Add an item to Settings
I will try it .thx
Sent from my HTC X515d using xda premium

Modding - Tweaks - General Changes - Information Sharing

Modding - Tweaks - General Changes - Information Sharing​
Hi all firstly i would like to say i am very much still a learner when it come to Android modding and have only been doing this for a couple of months as something new to keep me learning, This is just a thread i am using to keep some of the information and edits i utilise, due to the fact i have 6 kids busy life and bad memory i thought it a good idea to keep this somewhere besides my PC for future reference.
Thread Requirements.
1. Basic knowledge of compiling and decompiling apk and jar files so they can be edited.
2. Notepad++ Download
3. APK editing tool - I have been using APK Multi Tool Version 2.0 WIP
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I will start with CustomSettings.apk as i am editing quite often at this time,
I take no credit for this amazing apk that credit goes completely to ficeto
All drawable icons unless already included will have to be added by the modder
Adding CustomSettings.apk to SecSettings
Firstly you will need to register customsettings to your system to do this
1. pull/extract your SecSettings.apk and decompile it
2.open res/xml/display_headers add line anywhere in display_headers ( where you place it will vary where its shown in phone menu )
Example i placed mine just after the line
Code i placed mine after
Code:
<header android:id="@id/setting_search">
<intent android:targetPackage="com.android.settings" android:targetClass="com.android.settings.search.SearchMain" />
</header>
Code to add to display_headers
Code:
<header android:title="@string/BlaizzrRom" />
<header android:icon="@drawable/ic_settings_blaizzr" android:title="@string/Rom_Ext_Fea">
<intent android:targetPackage="com.ficeto.customsettings" android:action="android.intent.action.MAIN" android:targetClass="com.ficeto.customsettings.RandomActivity" />
</header>
Now open res/values/strings.xml and add these lines, You can change the highlighted text in RED to whatever you want to display in you'r menu, The GREEN highlight text is the Category text
Code to add to Strings[/B
Code:
<string name="Rom_Ext_Fea">[COLOR="Red"]Extended Features[/COLOR]</string>
<string name="BlaizzrRom">[COLOR="Lime"]Blaizzr Rom Settings[/COLOR]</string>
Save\ Recompile Secsettings\ Ensure CustomSettings.apk is already on phone and permissions set correct, push SecSettings to phone set permissions restart and you should now have your extended menu displayed.
It wont really do much ATM until there are some options added..
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Naming CustomSettings Menu
Once you have CustomSettings registered to your system you may want to rename to new menu to better suit your custom rom, To do this
1. decompile Customsettins.apk
2. go res/value/strings.xml
3 Find the entry named " app_name " change this to whatever you want the new menu to be registered as within your system.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CustomSettings clickable changing menu headers ( pics )
This one has abit more to it to follow, i will try and make it easy to understand ( sorry if it gets confusing )
1. select 2 pics you wish to use for your headers, name them to easily identify, preferably bnp format but it does not matter to much, i have used gif,jpeg and other with success ( gifs dont animate though )
2. add selected pics to customsettings/res/drawable
3. in same drawable folder create 2 new xml files call these anything you like but it may be usefull to name them something like "rombanner01" & rombanner02 for easy callback
4. in rombanner01.xml add this code ( red highlight area is where you add the name of your pic, same pic name in both entries )
Code:
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/[COLOR="Red"]addsecondpicnamehere[/COLOR]" />
<item android:state_selected="true" android:drawable="@drawable/[COLOR="Red"]addsecondpicnamehere[/COLOR]" />
<item android:drawable="@drawable/rombanner02" />
</selector>
5. in rombanner02 add this code ( red highlight area is where you add the name of your other pic )
Code:
<?xml version="1.0" encoding="utf-8"?>
<animation-list android:oneshot="true"
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:duration="3000" android:drawable="@drawable/[COLOR="Red"]addfirstpicnamehere[/COLOR]" />
</animation-list>
6.goto res/loyout and create a new xml file ( name it anything you want for this guide i will use rombanner.xml) add this code
In this code set android:layout_width to the screen width of your device, --- change android:layout_height to the height you want your pic to display at.
Code:
<?xml version="1.0" encoding="utf-8"?>
<ImageView android:layout_gravity="center" android:paddingBottom="3.0dip" android:clickable="true" android:layout_width="1080.0px" android:layout_height="225.0px" android:src="@drawable/rombanner01" android:scaleType="fitXY"
xmlns:android="http://schemas.android.com/apk/res/android" />
7. Now ensure all these new xml files are saved. Now open res/xml/prefences.xml
add this code right below the xmlns:android="http://schemas.android.com/apk/res/android"> line of text ( highlighed red text is where you add the name of your new layout.xml )
Code:
<PreferenceScreen android:layout="@layout/[COLOR="Red"]rombanner[/COLOR]" android:selectable="true" android:key="rom_logo" />
Now recompile your customsettings push to phone and set correct properties and check your new menu you should now have your pic at top of new menu page and when you press it it should switch to your alt picture.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CustomSettings general pages setup
Everything related to page setup is basically controlled by the res/xml/preferences.xml
to setup a basic page you would use code ( the space between the code would be filled with your code for on that page.
Code:
<PreferenceScreen android:title="Basic Apps Control" android:summary="Control over some of the included applications">
</PreferenceScreen>
Above code will create a page called Basic Apps Control, with a subtext of Control over some of the included applications
CustomSettings adding sub-header / Category
This is used to split pages into sub Categories the code is
Code:
<PreferenceCategory android:title="Application Selection">
</PreferenceCategory>
Above code will create a category called Application selection.
To utilise together we just add them together, Firstly we create the page itself then we add the sub category like so
Code:
<PreferenceScreen android:title="Basic Apps Control" android:summary="Control over some of the included applications">
<PreferenceCategory android:title="Application Selection">
</PreferenceCategory>
</PreferenceScreen>
adding your code between them will add the that item to this page in this category. eg
Code:
<PreferenceScreen android:title="Basic Apps Control" android:summary="Control over some of the included applications">
<PreferenceCategory android:title="Application Selection">
<Preference android:icon="@drawable/ic_SuperSu" android:title="SuperSu" android:key="activity;eu.chainfire.supersu;eu.chainfire.supersu.MainActivity" android:summary="Root Access Control" />
</PreferenceCategory>
</PreferenceScreen>
Will add a tab for superSu and launch the application upon being selected
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is just the start there is much more to come, sorry i can only add info as i get chance and i will continue to add as i go, if there are any questions or anything else please ask, and if you have any guides you would like to share then please let me know and i will add/link them
Hope this helps someone somewhere and not just me lol
BongOfWar
3minit quick launch and S Finder, Quick Connect on one panel with toggle Android L
First i take no credit for the quick launch mod that belongs to @gharrington
You will need to download 3minit quick launcher smali from here
Just grab the smali files as the codes on there do not work for Lillipop.
now decompile SystemUI.apk and goto..
SystemUI.apk\res\layout open quick_connect_layout_zero.xml
Change it to following:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:id="@id/sfinder_qconnect_layout" android:background="@drawable/quick_connect_layout_bg" android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="@dimen/finder_connect_layout_height"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<HorizontalScrollView android:scrollbars="none" android:layout_width="fill_parent" android:layout_height="@dimen/3minit_quick_layout_height">
<com.android.systemui.statusbar.policy.quicklaunch.QuickLaunchContainer android:gravity="center" android:layout_width="wrap_content" android:layout_height="@dimen/3minit_quick_layout_height" android:layout_centerHorizontal="true" />
</HorizontalScrollView>
<LinearLayout android:orientation="vertical" android:id="@id/sfinder_qconnect_layout" android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="@dimen/finder_connect_layout_height">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:paddingLeft="@dimen/finder_connect_button_padding_right" android:paddingTop="@dimen/finder_connect_button_padding_top" android:paddingRight="@dimen/finder_connect_button_padding_left" android:paddingBottom="@dimen/finder_connect_button_padding_bottom" android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="wrap_content">
<RelativeLayout android:id="@id/sfinder_button_layout" android:background="@drawable/ripple_drawable" android:focusable="true" android:nextFocusLeft="@id/quick_connect_button_layout" android:nextFocusRight="@id/quick_connect_button_layout" android:clickable="true" android:layout_width="0.0dip" android:layout_height="@dimen/finder_connect_button_height" android:layout_weight="0.5" android:layout_marginEnd="9.0dip">
<TextView android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:gravity="center" android:id="@id/sfinder_button_big" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/accessibility_sfinder_button" android:singleLine="true" android:drawableLeft="@drawable/tw_quick_panel_quick_sfinder_button_image" android:drawablePadding="@dimen/tw_quick_panel_sfinder_qconnect_drawable_padding" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:fontFamily="sec-roboto-light" />
</RelativeLayout>
<ImageView android:id="@id/expanded_divider_3" android:background="@color/quickpanel_button_divider_color" android:layout_width="1.0dip" android:layout_height="17.0dip" android:layout_marginTop="18.0dip" android:layout_marginBottom="18.0dip" android:alpha="@dimen/quickpanel_button_divider_alpha" android:layout_toStartOf="@id/sfinder_button_layout" />
<RelativeLayout android:id="@id/quick_connect_button_layout" android:background="@drawable/ripple_drawable" android:focusable="true" android:nextFocusLeft="@id/sfinder_button_layout" android:nextFocusRight="@id/sfinder_button_layout" android:clickable="true" android:layout_width="0.0dip" android:layout_height="@dimen/finder_connect_button_height" android:layout_weight="0.5" android:layout_marginStart="9.0dip">
<TextView android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:gravity="center" android:id="@id/qconnect_button_big" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/accessibility_qconnect_button" android:singleLine="true" android:drawableLeft="@drawable/tw_quick_panel_quick_qconnect_button_image" android:drawablePadding="@dimen/tw_quick_panel_sfinder_qconnect_drawable_padding" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:fontFamily="sec-roboto-light" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Now goto SystemUI\res\values\dimens.xml search for "finder_connect_layout_height"
Change code in Red, Add code in Green
Code:
<dimen name="finder_connect_layout_height">[COLOR="Red"]132.0dip[/COLOR]</dimen>
[COLOR="Green"]<dimen name="3minit_quick_layout_height">75.0dip</dimen>[/COLOR]
Toggle
Goto SystemUI\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali
search for code "iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQconnectSfinderView:Lcom/android/systemui/statusbar/QconnectSfinderView;
" (( I use this line as only had 1 line of this in smali ) if you find more than 1 of this line let me know and i will edit guide )
Directly below this code add
Code:
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "3minit_quick_connect_toggle"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-nez v0, :cond_5
Custom Settings
Basic Switch and SystemUI Restart..
Code:
<SwitchPreference android:title="Quickconnect Panel" android:key="3minit_quick_connect_toggle" android:summaryOn="Panel is hidden" android:summaryOff="Panel is shown" />
<Preference android:title="Restart SystemUI" android:key="tool#restartsystemui" android:summary="Tap after setting 3minit Quick Connect Panel" />
Screen shots below of both panel showing and panel gone through using toggle
Good
mine
mine2
new guide added, hope this is useful to someone

A.O.K.P Ram Bar on Recents Panel with SwitchPreference & ColorpickerPreference

This is the update version of this guide : https://forum.xda-developers.com/showpost.php?p=65925174&postcount=5419
Feature Included:
-On/Off Switch
-Color Used Ram Text
-Color Free Ram Text
on recent panel.
Tested on AOSP MM 6.0
Follow the instruction:
Part 1
SystemUI.apk Part
Download the attached file
merge systemui folder with your decompiled SystemUI.apk
open SystemUI/res/layout/recents.xml
at the end before the </ FrameLayout> add this
Code:
<com.android.systemui.rz.LeftLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="35.0dip" key="aokpram_recent" android:layout_weight="1.0">
<com.zidni.recents.aokpram android:layout_width="fill_parent" android:layout_height="30.0dip" />
</com.android.systemui.rz.LeftLayout>
open SystemUI/res/values/strings.xml
add this string at end of file add this
Code:
<string name="quick_panel_data_usage">Data usage</string>
<string name="service_background_processes">%1$s free</string>
<string name="service_foreground_processes">%1$s used</string>
save changes & recompile, sign, push systemui.apk
now follow the 2nd part.
Part 2
Settings or Rom Control Part
if you already have rom control app then just add this line to your ui.xml or whatever you like
Code:
<SwitchPreference android:title="RAM Bar on Recent App" android:key="aokpram_recent" android:defaultValue="true" android:summaryOn="Shown" android:summaryOff="Hidden" />
<com.wubydax.romcontrol.prefs.ColorPickerPreference android:title="Used Ram Text Color" android:key="ram_color1" android:defaultValue="\#ffffffff" app:packageNameToKill="com.android.systemui" app:isSilent="false" alphaSlider="true" hexValue="true" />
<com.wubydax.romcontrol.prefs.ColorPickerPreference android:title="Free Ram Text Color" android:key="ram_color2" android:defaultValue="\#ffffffff" app:packageNameToKill="com.android.systemui" app:isSilent="false" alphaSlider="true" hexValue="true" />
done.
but if you don't have rom control then you need add in settings.....
follow this guide to add color preferences - https://forum.xda-developers.com/cr...s/guide-color-picker-preferences-rom-t3429822
follow this guide to add switch preference - https://forum.xda-developers.com/showpost.php?p=64964525&postcount=3
now add this code to your preference xml
Code:
<com.android.settings.cyanogenmod.SystemSettingSwitchPreferenceandroid:title="RAM Bar on Recent App" android:key="aokpram_recent" android:defaultValue="true" android:summaryOn="Shown" android:summaryOff="Hidden" />
<com.android.settings.rz.colorpicker.ColorPickerPreference android:title="Used Ram Text Color" android:key="ram_color1" android:defaultValue="\#ffffffff" app:packageNameToKill="com.android.systemui" app:isSilent="false" alphaSlider="true" hexValue="true" />
<com.android.settings.rz.colorpicker.ColorPickerPreference android:title="Free Ram Text Color" android:key="ram_color2" android:defaultValue="\#ffffffff" app:packageNameToKill="com.android.systemui" app:isSilent="false" alphaSlider="true" hexValue="true" />
Credits:
@UNS4 4pda.ru
@madgit xda
@venkat kamesh xda
@Zidni xda (me)
reserved
thank you ....its working my Samsung S duos 2 fine
missindia said:
thank you ....its working my Samsung S duos 2 fine
Click to expand...
Click to collapse
Welcome :laugh:
Great work! I have a small issue, I'm not sure if it is with the LeftLayout code or the CMSwitchPreference. Everytime I open my Settings/Display (where I put the switch) it reverts back to the default value without me changing it. Has anyone else noticed this issue? Hopefully there will be an easy fix for it. Thanks again.
@Zidni I have an update for this mod for those who are using settings instead of ROM control. It will allow them to use SwitchPreference instead of com.android.settings.cyanogenmod.SystemSettingSwitchPreference. Done this new way, the switch generates a boolean value in shared_prefs (where the CMSwitch doesn't) so the switches don't revert back to default every time the page/fragment is inflated.
Instructions are included in the zip.
RealWelder said:
Great work! I have a small issue, I'm not sure if it is with the LeftLayout code or the CMSwitchPreference. Everytime I open my Settings/Display (where I put the switch) it reverts back to the default value without me changing it. Has anyone else noticed this issue? Hopefully there will be an easy fix for it. Thanks again.
@Zidni I have an update for this mod for those who are using settings instead of ROM control. It will allow them to use SwitchPreference instead of com.android.settings.cyanogenmod.SystemSettingSwitchPreference. Done this new way, the switch generates a boolean value in shared_prefs (where the CMSwitch doesn't) so the switches don't revert back to default every time the page/fragment is inflated.
Instructions are included in the zip.
Click to expand...
Click to collapse
well you did good job.... hope it will be helpful for other peoples :good:
Will it work on crdroid (pie)?
Zidni said:
Part 2
Settings or Rom Control Part
if you already have rom control app then just add this line to your ui.xml or whatever you like
Code:
<SwitchPreference android:title="RAM Bar on Recent App" android:key="aokpram_recent" android:defaultValue="true" android:summaryOn="Shown" android:summaryOff="Hidden" />
<com.wubydax.romcontrol.prefs.ColorPickerPreference android:title="Used Ram Text Color" android:key="ram_color1" android:defaultValue="\#ffffffff" app:packageNameToKill="com.android.systemui" app:isSilent="false" alphaSlider="true" hexValue="true" />
<com.wubydax.romcontrol.prefs.ColorPickerPreference android:title="Free Ram Text Color" android:key="ram_color2" android:defaultValue="\#ffffffff" app:packageNameToKill="com.android.systemui" app:isSilent="false" alphaSlider="true" hexValue="true" />
done.
Click to expand...
Click to collapse
thanks your work! i got trouble about that section, how to inject code into romcontrol? what's the if you already have rom control app then just add this line to your ui.xml or whatever you like? Where's ui.xml?
Great job !
it work on AOSP android 10 ???

Question Disable Swipe To Dismiss (Go Back)?

TL;DR - Is there a way to disable the swipe right to go back feature?
I recently sideloaded a VNC viewer on the Watch 4 to access apps on my phone/computer, and it works well except when I try to move the mouse cursor to the right, the watch exits and disconnects the VNC client. Same problem with scrolling the screen to the right when zoomed in. The only workaround that I have found is to move the cursor to the top or bottom of the screen with a slight rightward motion until the cursor is far to the right, then move it back down/up. Is there a way to disable the swipe right to go back feature, or is there an on-screen input app, such as a joystick, that will work? Perhaps a different VNC viewer might work better? Thanks!
Do not think there is a way to disable the swipe. At least I could not find one.
Also, haven't seen any way to disable it....
TacoDeMuerte said:
TL;DR - Is there a way to disable the swipe right to go back feature?
I recently sideloaded a VNC viewer on the Watch 4 to access apps on my phone/computer, and it works well except when I try to move the mouse cursor to the right, the watch exits and disconnects the VNC client. Same problem with scrolling the screen to the right when zoomed in. The only workaround that I have found is to move the cursor to the top or bottom of the screen with a slight rightward motion until the cursor is far to the right, then move it back down/up. Is there a way to disable the swipe right to go back feature, or is there an on-screen input app, such as a joystick, that will work? Perhaps a different VNC viewer might work better? Thanks!
Click to expand...
Click to collapse
Thats an OS feature, if there was a way to disable it you would probably lose all gestures.
Thanks for the replies guys! I had a hunch that it was more of a communication between the apps and the OS and have found some information. There are flags that need to be set within the app that disable swipe to dismiss while a scrollable overlay is selected. This is how something like Google Maps on the watch will allow tap + drag in any direction as well as scrolling through menus in other apps. I would think there would also be a flag/setting somewhere within the OS to disable swipe-to-dismiss altogether, but perhaps we will need to wait for custom ROMs for that. In the meantime, I will work on customizing the UI of apps to ignore swipe-to-dismiss.
Some additional information:
https://developer.android.com/reference/kotlin/androidx/wear/widget/SwipeDismissFrameLayout
Code:
"To suppress a swipe-dismiss gesture, at least one contained view must be scrollable,
indicating that it would like to consume any horizontal touch gestures in that direction.
In this case this view will only allow swipe-to-dismiss on the very edge of the left-hand-side of the screen.
If you wish to entirely disable the swipe-to-dismiss gesture,
setSwipeable can be used for more direct control over the feature."
wear-os - swipedismissframelayout - android wear disable swipe to dismiss
Code:
There is an attribute in window style to disable this behavior:
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light">
<item name="android:windowSwipeToDismiss">false</item>
</style>
TacoDeMuerte said:
Thanks for the replies guys! I had a hunch that it was more of a communication between the apps and the OS and have found some information. There are flags that need to be set within the app that disable swipe to dismiss while a scrollable overlay is selected. This is how something like Google Maps on the watch will allow tap + drag in any direction as well as scrolling through menus in other apps. I would think there would also be a flag/setting somewhere within the OS to disable swipe-to-dismiss altogether, but perhaps we will need to wait for custom ROMs for that. In the meantime, I will work on customizing the UI of apps to ignore swipe-to-dismiss.
Some additional information:
https://developer.android.com/reference/kotlin/androidx/wear/widget/SwipeDismissFrameLayout
Code:
"To suppress a swipe-dismiss gesture, at least one contained view must be scrollable,
indicating that it would like to consume any horizontal touch gestures in that direction.
In this case this view will only allow swipe-to-dismiss on the very edge of the left-hand-side of the screen.
If you wish to entirely disable the swipe-to-dismiss gesture,
setSwipeable can be used for more direct control over the feature."
wear-os - swipedismissframelayout - android wear disable swipe to dismiss
Code:
There is an attribute in window style to disable this behavior:
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light">
<item name="android:windowSwipeToDismiss">false</item>
</style>
Click to expand...
Click to collapse
I dont seem to get it working. Could you explain it in steps to make someone like me who doesnt understand code to make this work?
Beekitu said:
I dont seem to get it working. Could you explain it in steps to make someone like me who doesnt understand code to make this work?
Click to expand...
Click to collapse
There are different methods out there, but try this as a starting point:
1. Open Android Studio and create a new project. File > New > New Project > Wear OS > Blank Activity > Next > Finish
2. Convert the root layout into a SwipeDismissFrameLayout in activity_main.xml. From the file explorer on the left: app > res > layout > activity_main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.wear.widget.SwipeDismissFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/box_inset_layout_padding"
tools:context=".MainActivity"
tools:deviceIds="wear">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/inner_frame_layout_padding"
app:layout_boxedEdges="all">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</FrameLayout>
</androidx.wear.widget.SwipeDismissFrameLayout>
3. Disable SwipeToDismiss via style and theme in a resource file. app > res > values > dimens.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Because the window insets on round devices are larger than 15dp, this padding only applies
to square screens.
-->
<dimen name="box_inset_layout_padding">0dp</dimen>
<!--
This padding applies to both square and round screens. The total padding between the buttons
and the window insets is box_inset_layout_padding (above variable) on square screens and
inner_frame_layout_padding (below variable) on round screens.
-->
<dimen name="inner_frame_layout_padding">5dp</dimen>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowSwipeToDismiss">false</item>
</style>
</resources>
That should be all you need to get started. Once that is working, read over the code and make the necessary edits to achieve the desired result. For example, the text "Hello Round World!" is still swipeable, but the app doesn't close on a swipe, so you would need to edit the text box's attributes to prevent that from moving on a swipe. Also, check out the Google Maps example project for additional information. Keep in mind that the non-swipe to dismiss layouts are derived from the "Fragment" type of layout.
TacoDeMuerte said:
There are different methods out there, but try this as a starting point:
1. Open Android Studio and create a new project. File > New > New Project > Wear OS > Blank Project
2. Convert the root layout into a SwipeDismissFrameLayout in activity_main.xml. From the file explorer on the left: app > res > layout > activity_main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.wear.widget.SwipeDismissFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/box_inset_layout_padding"
tools:context=".MainActivity"
tools:deviceIds="wear">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/inner_frame_layout_padding"
app:layout_boxedEdges="all">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</FrameLayout>
</androidx.wear.widget.SwipeDismissFrameLayout>
3. Disable SwipeToDismiss via style and theme in a resource file. app > res > values > dimens.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Because the window insets on round devices are larger than 15dp, this padding only applies
to square screens.
-->
<dimen name="box_inset_layout_padding">0dp</dimen>
<!--
This padding applies to both square and round screens. The total padding between the buttons
and the window insets is box_inset_layout_padding (above variable) on square screens and
inner_frame_layout_padding (below variable) on round screens.
-->
<dimen name="inner_frame_layout_padding">5dp</dimen>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowSwipeToDismiss">false</item>
</style>
</resources>
That should be all you need to get started. Once that is working, read over the code and make the necessary edits to achieve the desired result. For example, the text "Hello Round World!" is still swipeable, but the app doesn't close on a swipe, so you would need to edit the text box's attributes to prevent that from moving on a swipe. Also, check out the Google Maps example project for additional information. Keep in mind that the non-swipe to dismiss layouts are derived from the "Fragment" type of layout.
Click to expand...
Click to collapse
I'm already stuck on step 2. After I chose Black Project in step 1, it asks me for some information about the project, not sure what I should put there.. And on step 2 im confused from the very start..
Beekitu said:
I'm already stuck on step 2. After I chose Black Project in step 1, it asks me for some information about the project, not sure what I should put there.. And on step 2 im confused from the very start..
Click to expand...
Click to collapse
Just click "Next" then "Finish". You can change the name of your project if you want and can also change the programming language to Java or Kotlin, but shouldn't be necessary. Just click finish.
TacoDeMuerte said:
Just click "Next" then "Finish". You can change the name of your project if you want and can also change the programming language to Java or Kotlin, but shouldn't be necessary. Just click finish.
Click to expand...
Click to collapse
alright. this is currently what I am seeing. Can you explain where I need to go in step 2 using the screenshot?
Beekitu said:
alright. this is currently what I am seeing. Can you explain where I need to go in step 2 using the screenshot?
Click to expand...
Click to collapse
Click "Code" or "Split" near the top right corner. Remember where this is as it comes in handy later. I would also add that this thread isn't meant to be a tutorial on Android Studio, and would highly recommend searching for an introduction video tutorial of Android Studio before proceeding further.
TacoDeMuerte said:
Click "Code" or "Split" near the top right corner. Remember where this is as it comes in handy later. I would also add that this thread isn't meant to be a tutorial on Android Studio, and would highly recommend searching for an introduction video tutorial of Android Studio before proceeding further.
Click to expand...
Click to collapse
I understand nothing about coding and dont plan on learning coding. I just want to disable swipe right gesture on my watch. after that I do not plan on using Android studio in the future..
Beekitu said:
I understand nothing about coding and dont plan on learning coding. I just want to disable swipe right gesture on my watch. after that I do not plan on using Android studio in the future..
Click to expand...
Click to collapse
Oh I see. Unfortunately, these steps will not accomplish what you need. These steps are for app development. The solution to disabling the swipe gesture has still not been found. I suspect it will require root access and maybe a custom kernel or ROM. Some people have mentioned patching individual apps to disable swipe to dismiss, but as far as I know, they haven't posted the process to do so. I think it involves decompiling the .apk, making similar edits to the steps above, then recompiling, which is a more complicated process than the steps I posted, and would need to be done for every app you use.
I believe we will have to wait for root access to disable the gesture altogether.
TacoDeMuerte said:
Oh I see. Unfortunately, these steps will not accomplish what you need. These steps are for app development. The solution to disabling the swipe gesture has still not been found. I suspect it will require root access and maybe a custom kernel or ROM. Some people have mentioned patching individual apps to disable swipe to dismiss, but as far as I know, they haven't posted the process to do so. I think it involves decompiling the .apk, making similar edits to the steps above, then recompiling, which is a more complicated process than the steps I posted, and would need to be done for every app you use.
I believe we will have to wait for root access to disable the gesture altogether.
Click to expand...
Click to collapse
Okay, thanks anyways.. sorry for wasting your time.
Have a great day
Beekitu said:
Okay, thanks anyways.. sorry for wasting your time.
Have a great day
Click to expand...
Click to collapse
Not a problem. If a solution is found, it will be posted on this thread.
hi, i found a fun game for wear os, i installed it on my watch, but i can't turn off the swipe to exit, can anyone help?
mustafamfc said:
hi, i found a fun game for wear os, i installed it on my watch, but i can't turn off the swipe to exit, can anyone help?
Click to expand...
Click to collapse
To disable the swipe gesture, you'll need to decompile and patch the apk. I can't help you with decompiling, but there are a few options on this thread: How to decompile an APK or DEX file on Android platform
Once decompiling is complete, follow the steps posted above. For your convenience, I will post them again here, starting with step 2 in Android Studio:
TacoDeMuerte said:
2. Convert the root layout into a SwipeDismissFrameLayout in activity_main.xml. From the file explorer on the left: app > res > layout > activity_main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.wear.widget.SwipeDismissFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/box_inset_layout_padding"
tools:context=".MainActivity"
tools:deviceIds="wear">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/inner_frame_layout_padding"
app:layout_boxedEdges="all">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</FrameLayout>
</androidx.wear.widget.SwipeDismissFrameLayout>
Click to expand...
Click to collapse
TacoDeMuerte said:
3. Disable SwipeToDismiss via style and theme in a resource file. app > res > values > dimens.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Because the window insets on round devices are larger than 15dp, this padding only applies
to square screens.
-->
<dimen name="box_inset_layout_padding">0dp</dimen>
<!--
This padding applies to both square and round screens. The total padding between the buttons
and the window insets is box_inset_layout_padding (above variable) on square screens and
inner_frame_layout_padding (below variable) on round screens.
-->
<dimen name="inner_frame_layout_padding">5dp</dimen>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowSwipeToDismiss">false</item>
</style>
</resources>
Click to expand...
Click to collapse
NOTE: You may need to repeat step 3 for any style and theme in the app that you want to disable the swipe gesture on. It doesn't necessarily have to be in the 'dimens.xml' file, but it will be in the 'res' folder. Since this step changes from app to app, you'll need to figure out which changes are necessary on your own. Once you're done, recompile and deploy the modded apk.
TacoDeMuerte said:
To disable the swipe gesture, you'll need to decompile and patch the apk. I can't help you with decompiling, but there are a few options on this thread: How to decompile an APK or DEX file on Android platform
Once decompiling is complete, follow the steps posted above. For your convenience, I will post them again here, starting with step 2 in Android Studio:
NOTE: You may need to repeat step 3 for any style and theme in the app that you want to disable the swipe gesture on. It doesn't necessarily have to be in the 'dimens.xml' file, but it will be in the 'res' folder. Since this step changes from app to app, you'll need to figure out which changes are necessary on your own. Once you're done, recompile and deploy the modded apk.
Click to expand...
Click to collapse
hello, thank you for taking care of me, but I couldn't understand anything from what you said, if it doesn't bother you, if you can do what you are saying on any apk and publish it in the form of a video, I would be very useful, thank you

[TUTORIAL] External keyboard remapping without root [4.1+]

There is a great post about external keyboard remapping [TUTORIAL] External keyboard remapping [3.0+] but it's requires root access. You should read it first to get a general idea about external keyboard remapping.
Since Android 4.1 an app can provide additional keyboard layouts (Key Character Map files). After installation they can be found at Settings -> Language & input -> Physical keyboard (the exact path may vary).
As we already know from the previous tutorial, there are two types of files to customize a keyboard layout: Key Layout files and Key Character Map files. But there is an undocumented feature: it's possible to have KL-mappings in KCM-file! To do this we just need to add map before each KL-mapping.
Code:
# KeyboardLayout.kl
# Swap CapsLock and Left Ctrl
key 58 CTRL_LEFT
key 29 CAPS_LOCK
# KeyCharacterMap.kcm
# Do the same but in KCM-file
map key 58 CTRL_LEFT
map key 29 CAPS_LOCK
So we can to remap an external keyboard by installing an app! No root required!
But how to get such app? There are several ways:
1. Install an existing one.
2. Build it yourself.
3. Build with a tool.
Install an existing one​There aren't many apps I'm aware of. One of them is More Physical Keyboard Layouts (Google Play | GitHub). It has a lot of different layouts for different languages but can't customize the mappings.
Build it yourself​The most complicated way. It requires a knowledge in Android app development.
Take a look at More Physical Keyboard Layouts source code or Custom Keyboard Layout source code.
First of all you need to specify a receiver in AndroidManifest.xml file:
XML:
<receiver
android:name=".InputDeviceReceiver"
android:label="@string/keyboard_layouts_label">
<intent-filter>
<action android:name="android.hardware.input.action.QUERY_KEYBOARD_LAYOUTS" />
</intent-filter>
<meta-data
android:name="android.hardware.input.metadata.KEYBOARD_LAYOUTS"
android:resource="@xml/keyboard_layouts" />
</receiver>
And you don't even need to create the corresponding InputDeviceReceiver.java in the souce code .
After that add the corresponding keyboard_layouts.xml file in app/src/main/res/xml . For example
XML:
<?xml version="1.0" encoding="utf-8"?>
<keyboard-layouts xmlns:android="http://schemas.android.com/apk/res/android">
<keyboard-layout
android:name="keyboard_layout_en_us"
android:keyboardLayout="@raw/keyboard_layout_en_us"
android:label="@string/keyboard_layout_en_us_label" />
<keyboard-layout
android:name="keyboard_layout_ru"
android:keyboardLayout="@raw/keyboard_layout_ru"
android:label="@string/keyboard_layout_ru_label" />
</keyboard-layouts>
That file contains a list of your keyboard layouts. They are just plain KCM-files that you should put in app/src/main/res/raw.
Build with a tool​If you don't want to build it yourself there is ExKeyMo web app (NOT AVAILABLE ANYMORE - you'll have to run it locally. Visit project's GitHub page for details). Just enter the content of your KCM-file in the ExKeyMo's form and click Download. It will build the app for you.
There is a web-version of validatekeymaps tool if you need to check your .kcm file.

Categories

Resources