i do insist for anyone to pick v2.
clone is the same for any repo.
search online for git.exe
Inviato dal mio SM-G930F utilizzando Tapatalk
there is an async task in MainActivity if i am not mistaken that checks for root and will copy the script files f.e.
there is an async task in MainActivity if i am not mistaken that checks for root and will copy the script files f.e.
i would actually spend a couple of words in why you shouldn't remove it.
it will ask for root when it will need to execute an operation that requires it blocking the foreground ui tread untill the superuser pop will shown. meaning that this is a bad thing, because probably user won't understand what is going on and complain that the app freezes.
Inviato dal mio SM-G930F utilizzando Tapatalk
It was posted once before, search you would find your answer.
that is definitely not how it is intended.. it's way easier to create a new app for that! if you just want that it's way easier, no permission need at all - no need for priv-app and so on!I need it for supplemental apk for rom controls just for open links for some post.. it want to use it for all users not just with root
if you will share ANYWHERE ,not xda only, you'll need to share your sources, meaning the exact set of edits you did for a certain release, and whenever you make a change in the code for release, you'll have to provide updated sources.hello to all... so basically if Im going to post rom control on xda I'll need to drop a link to this thread or to both github links in op for it not to get banned ?! thanx!
Sent from Galaxy Beast 4 (aka Magnum) Powered by DN7 Rom
Build: samsung/a5xeltexx/a5xelte:7.0/NRD90M/A510FXXU4CQDK:user/release-keys
java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to android.widget.LinearLayout
at com.wubydax.romcontrol.v2.PrefsFragment.setUpNestedPreferenceLayout(PrefsFragment.java)
at com.wubydax.romcontrol.v2.PrefsFragment.onPreferenceClick(PrefsFragment.java)
at android.preference.Preference.performClick(Preference.java:1185)
at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:289)
at android.widget.AdapterView.performItemClick(AdapterView.java:339)
at android.widget.AbsListView.performItemClick(AbsListView.java:1717)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:4183)
at android.widget.AbsListView$13.run(AbsListView.java:6753)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
Guys Hello!
I have a problem using Rom Control in 7.0 Nougat, Tried by others RC Similarly I get the same error
I understand that I do not himCode:Build: samsung/a5xeltexx/a5xelte:7.0/NRD90M/A510FXXU4CQDK:user/release-keys java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to android.widget.LinearLayout at com.wubydax.romcontrol.v2.PrefsFragment.setUpNestedPreferenceLayout(PrefsFragment.java) at com.wubydax.romcontrol.v2.PrefsFragment.onPreferenceClick(PrefsFragment.java) at android.preference.Preference.performClick(Preference.java:1185) at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:289) at android.widget.AdapterView.performItemClick(AdapterView.java:339) at android.widget.AbsListView.performItemClick(AbsListView.java:1717) at android.widget.AbsListView$PerformClick.run(AbsListView.java:4183) at android.widget.AbsListView$13.run(AbsListView.java:6753) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
like framevork.jar
Previously used in MM 6.0.1 . This was not, there are any tips.
Thank you!
Thanks :good:, I'll try , my rc v2this is a known problem with nougat, but you can fix this way:
link
also i would suggest you to switch to rc v2 in the link above, much better
su shell settings put system white_music_for_keyguard
<com.wubydax.romcontrol.prefs.IntentDialogPreference
includeSearch="true"
setSeparatorString="\##"
android:key="choosen_app_gear"
android:title="Choose App" />
i'm sorry i don't really understant what you are trying to do!Hello people!
...and thanks for this Wonderful work!
I have a question... I have a lot to learn.
I want to have this:
I want choose the app...
I want that this app (es: org.videolan.vlc) is added to terminal command
Code:su shell settings put system white_music_for_keyguard
How to make it?
I have to use something like this:
a little bit edited...Code:<com.wubydax.romcontrol.prefs.IntentDialogPreference includeSearch="true" setSeparatorString="\##" android:key="choosen_app_gear" android:title="Choose App" />
and then?
maybe a script?
thanks in advance
i'm sorry i don't really understant what you are trying to do!
Inviato dal mio SM-G930F utilizzando Tapatalk
su shell settings put system white_music_for_keyguard org.videolan.vlc
Hi
I have a Huawei p9 lite...
In keyguard only Default Music Player is displayed.
I want to add other Players.
I can manually add Music Player with SQLEditor in "white_music_for_keyguard" key, but I want create a Popup:
All downloaded app are there,
I choose my personal Music Player,
Then selected Music Player goes to white_music_for_keyguard key.
For example:
terminal command works so (with VLC app):
Code:su shell settings put system white_music_for_keyguard org.videolan.vlc
<com.wubydax.romcontrol.prefs.IntentDialogPreference
includeSearch="true"
setSeparatorString=";"
android:key="white_music_for_keyguard"
android:title="@string/choose_app" />
it's been already asked and is not so stupid.. you can compile as separate app by now. we did not looked into it since most of our user are developping sammy based romHello
I`ll ask you how I can add this project to CM-based ROM sources? I`ll compile ROM with this app, how can I do this?
Sorry for stupid asks but I`m newbie :/
...For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights...
<string-array name="nav_drawer_items">
<item>SystemUI Mods</item>
<item>Phone Mods</item>
<item>Framework and General</item>
[COLOR="Blue"][B]<item>Power Menu</item>[/B][/COLOR]
<item>Useful Apps</item>
<item>Set Theme</item>
</string-array>
//Creates a list of NavItem objects to retrieve elements for the Navigation Drawer list of choices
public List<NavItem> getMenu() {
List<com.wubydax.romcontrol.NavItem> items = new ArrayList<>();
/*String array of item names is located in strings.xml under name nav_drawer_items
* If you wish to add more items you need to:
* 1. Add item to nav_drawer_items array
* 2. Add a valid material design icon/image to dir drawable
* 3. Add that image ID to the integer array below (int[] mIcons
* 4. The POSITION of your new item in the string array MUST CORRESPOND to the position of your image in the integer array mIcons
* 5. Create new PreferenceFragment or your own fragment or a method that you would like to invoke when a user clicks on your new item
* 6. Continue down this file to a method onNavigationDrawerItemSelected(int position) - next method
* 7. Add an action based on position. Remember that positions in array are beginning at 0. So if your item is number 6 in array, it will have a position of 5... etc
* 8. You need to add same items to the int array in NavigationDrawerFragment, which has the same method*/
String[] mTitles = getResources().getStringArray(R.array.nav_drawer_items);
int[] mIcons =
{R.drawable.ic_ui_mods,
R.drawable.ic_phone_mods,
R.drawable.ic_general_framework,
[B][COLOR="Blue"]R.drawable.ic_reboot,[/COLOR][/B]
R.drawable.ic_apps,
R.drawable.ic_settings};
for (int i = 0; i < mTitles.length && i < mIcons.length; i++) {
com.wubydax.romcontrol.NavItem current = new com.wubydax.romcontrol.NavItem();
current.setText(mTitles[i]);
current.setDrawable(mIcons[i]);
items.add(current);
}
return items;
}
@Override
public void onNavigationDrawerItemSelected(int position) {
/* update the main content by replacing fragments
* See more detailed instructions on the thread or in annotations to the previous method*/
setTitle(getMenu().get(position).getText());
switch (position) {
case 0:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new UIPrefsFragment()).commitAllowingStateLoss();
break;
case 1:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new PhonePrefsFragment()).commitAllowingStateLoss();
break;
case 2:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new FrameworksGeneralFragment()).commitAllowingStateLoss();
break;
case 3:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new AppLinksFragment()).commitAllowingStateLoss();
break;
case 4:
showThemeChooserDialog();
break;
}
}
@Override
public void onNavigationDrawerItemSelected(int position) {
/* update the main content by replacing fragments
* See more detailed instructions on the thread or in annotations to the previous method*/
setTitle(getMenu().get(position).getText());
switch (position) {
case 0:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new UIPrefsFragment()).commitAllowingStateLoss();
break;
case 1:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new PhonePrefsFragment()).commitAllowingStateLoss();
break;
case 2:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new FrameworksGeneralFragment()).commitAllowingStateLoss();
break;
[COLOR="blue"][B]case 3:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new PowerMenuFragment()).commitAllowingStateLoss();
break;[/B][/COLOR]
case [COLOR="blue"][B]4[/B][/COLOR]:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new AppLinksFragment()).commitAllowingStateLoss();
break;
case [COLOR="blue"][B]5[/B][/COLOR]:
showThemeChooserDialog();
break;
}
}
<[COLOR="red"]SwitchPreference[/COLOR]
android:defaultValue="true"
android:key="[COLOR="Red"]toggle_call_recording[/COLOR]"
android:summaryOff="Call recording is disabled"
android:summaryOn="Call recording is enabled"
android:title="Enable/Disable Call Recording" />
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
break;
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
[COLOR="Blue"][B]if (key.equals("toggle_call_recording")) {
Command c = new Command(0, "pkill com.android.incallui");
try {
RootTools.getShell(true).add(c);
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
} catch (RootDeniedException e) {
e.printStackTrace();
}
}[/B][/COLOR]
break;
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
[COLOR="blue"][B]if (key.equals("toggle_call_recording")) {
appRebootRequired("com.android.incallui");
}[/B][/COLOR]
break;
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
[COLOR="blue"][B] if (key.equals("toggle_call_recording")) {
appRebootRequired("com.android.incallui");
} else if (key.equals("some_other_key")) {
//do something you want
} else if (key.equals("again_some_key")) {
//do something different
}[/B][/COLOR]
break;
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
[COLOR="Blue"][B]switch (key){
case("toggle_call_recording"):
appRebootRequired("com.android.incallui");
break;
case("toggle_clock_visibility"):
appRebootRequired("com.android.systemui");
break;
case("some_other_key"):
//do something
break;
case("some_other_different_key"):
//do something different
break;
}[/B][/COLOR]
break;
<SwitchPreference
android:defaultValue="true"
android:key="clock_visibility"
android:summaryOff="Clock is hidden"
android:summaryOn="Clock is visible"
android:title="Set Clock Visibility" />
<CheckBoxPreference
android:defaultValue="false"
android:key="brightness_visibility"
android:summaryOff="Brightness slider hidden"
android:summaryOn="Brightness slider is visible"
android:title="Notification Brightness Visibility" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="2"
android:entries="@array/clock_position_entries"
android:entryValues="@array/clock_position_values"
android:key="any_clock_position"
android:title="Status Bar Clock Position" />
<com.wubydax.romcontrol.prefs.MyEditTextPreference
android:defaultValue="simpletext"
android:key="carrier_text"
android:title="Set Custom Carrier Text" />
<com.wubydax.romcontrol.prefs.ColorPickerPreference
alphaSlider="true"
android:defaultValue="-16777215"
android:key="clock_color"
android:title="Choose Clock Color" />
<com.wubydax.romcontrol.prefs.SeekBarPreference
min="0"
unitsRight="Kb/s"
android:defaultValue="10"
android:key="network_traffic_autohide_threshold"
android:max="100"
android:title="Autohide Threshold" />
<com.wubydax.romcontrol.prefs.IntentDialogPreference
includeSearch="true"
setSeparatorString="\##"
android:key="choosen_app_gear"
android:title="Choose App" />
<com.wubydax.romcontrol.prefs.FilePreference
android:key=[COLOR="red"]"testfile"[/COLOR]
android:summaryOff="File doesn't exist"
android:summaryOn="File exists"
android:title="Test File Preference" />
[COLOR="Green"]File[/COLOR] [COLOR="Blue"]file[/COLOR] = new [COLOR="green"]File[/COLOR]("[COLOR="Purple"]/data/data/com.wubydax.romcontrol/testfile[/COLOR]");
if(file.exists){
int i = 1;
} else {
i = 0;
}
<PreferenceScreen
android:key=[COLOR="Red"]"script#test"[/COLOR]
android:summary="Click see what happens"
android:title="New Preference Screen" />
if (script.exists()) {
[COLOR="Blue"][B]boolean isChmoded = script.canExecute() ? true : false;
if (!isChmoded) {
script.setExecutable(true);
}[/B][/COLOR]
Command command = new Command(0, pathToScript) {
@Override
public void commandCompleted(int id, int exitcode) {
super.commandCompleted(id, exitcode);
if (exitcode != 0) {
Toast.makeText(c, String.valueOf(exitcode), Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(c, "Executed Successfully", Toast.LENGTH_SHORT).show();
}
}
};
try {
RootTools.getShell(true).add(command);
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
} catch (RootDeniedException e) {
e.printStackTrace();
}
}
<PreferenceScreen
android:key=[COLOR="Red"]"com.wubydax.gearreboot.RebootActivity"[/COLOR]
android:summary="Opens TWSwipe app to help you choose a different swipe activity"
android:title="Reset TWSwipe Action" />
[COLOR="Red"]<PreferenceScreen
android:summary="New Preference screen"
android:title="New Preference Screen">[/COLOR] [COLOR="Green"]<-- Start of nested preference screen[/COLOR]
<PreferenceCategory android:title="new category" />
<CheckBoxPreference
android:key="text_checkbox"
android:title="Checkbox" />
<SwitchPreference
android:key="test_switch"
android:title="Switch" />
[COLOR="Red"]</PreferenceScreen>[/COLOR] [COLOR="Green"]<-- End of nested preference screen[/COLOR]
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
[COLOR="Red"] <PreferenceCategory android:title="Status Bar Mods">[/COLOR] [COLOR="Green"]<-- start of preference category[/COLOR]
<SwitchPreference
android:defaultValue="true"
android:key="clock_visibility"
android:summaryOff="Clock is hidden"
android:summaryOn="Clock is visible"
android:title="Set Clock Visibility" />
<CheckBoxPreference
android:defaultValue="false"
android:key="brightness_visibility"
android:summaryOff="Brightness slider hidden"
android:summaryOn="Brightness slider is visible"
android:title="Notification Brightness Visibility" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="2"
android:entries="@array/clock_position_entries"
android:entryValues="@array/clock_position_values"
android:key="any_clock_position"
android:title="Status Bar Clock Position" />
<com.wubydax.romcontrol.prefs.MyEditTextPreference
android:defaultValue="simpletext"
android:key="carrier_text"
android:title="Set Custom Carrier Text"
/>
<com.wubydax.romcontrol.prefs.ColorPickerPreference
alphaSlider="true"
android:defaultValue="-16777215"
android:key="clock_color"
android:title="Choose Clock Color" />
<PreferenceScreen
android:key="script#test"
android:summary="Click see what happens"
android:title="New Preference Screen" />
<com.wubydax.romcontrol.prefs.SeekBarPreference
min="0"
unitsRight="Kb/s"
android:defaultValue="10"
android:icon="@null"
android:key="network_traffic_autohide_threshold"
android:max="100"
android:title="Autohide Threshold" />
<PreferenceScreen
android:summary="New Preference screen"
android:title="New Preference Screen">
<PreferenceCategory android:title="new category" />
<CheckBoxPreference
android:key="text_checkbox"
android:title="Checkbox" />
<SwitchPreference
android:key="test_switch"
android:title="Switch" />
</PreferenceScreen>
<com.wubydax.romcontrol.prefs.IntentDialogPreference
includeSearch="true"
setSeparatorString="\##"
android:key="choosen_app_gear"
android:title="Choose App" />
<com.wubydax.romcontrol.prefs.FilePreference
android:key="testfile"
android:summaryOff="File doesn't exist"
android:summaryOn="File exists"
android:title="Test File Preference" />
[COLOR="red"]</PreferenceCategory>[/COLOR] [COLOR="Green"]<-- end of PreferenceCategory[/COLOR]
</PreferenceScreen>
<attr name="my_logo" format="reference"/>
<item name="my_logo">@drawable/logo_dark</item>
<item name="my_logo">@drawable/logo_light</item>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:layout_width="fill_parent"
android:layout_marginLeft="45dp"
android:layout_marginRight="45dp"
android:layout_height="wrap_content"
android:src="?my_logo" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen
android:layout_width="match_parent"
android:layout_height="135dp"
android:layout="@layout/my_logo" >
</PreferenceScreen>
<PreferenceCategory
android:title="External Links" />
<PreferenceScreen
android:icon="@drawable/xda"
android:title="XDA ROM Thread"
android:summary="Click to visit the ROM thread">
<intent
android:action="android.intent.action.VIEW"
android:data="http://xdaforums.com/sprint-galaxy-s5/development/rom-v5-0-mod-control-floating-windows-t3016692" />
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/darksyde"
android:title="Team Darksyde Themes"
android:summary="By willowmaker420 and JoeyDuran ">
<intent
android:action="android.intent.action.VIEW"
android:data="http://xdaforums.com/sprint-galaxy-s5/themes-apps/theme-mod-t3043481" />
</PreferenceScreen>
<PreferenceCategory
android:title="MOAR ROM Developers" />
<PreferenceScreen
android:icon="@drawable/tdunham"
android:title="tdunham"
android:summary="The mod master" >
<intent
android:icon="@drawable/tdunham"
android:action="android.intent.action.VIEW"
android:data="http://xdaforums.com/member.php?u=1042140" />
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/rompnit"
android:title="rompnit"
android:summary="What's he do?">
<intent
android:icon="@drawable/rompnit"
android:action="android.intent.action.VIEW"
android:data="http://xdaforums.com/member.php?u=1167171" />
</PreferenceScreen>
</PreferenceScreen>
public void allGroups(Preference p) {
PreferenceScreen ps = (PreferenceScreen) p;
ps.setOnPreferenceClickListener(this);
[COLOR="Red"]
if(ps.getIntent()!=null){
Intent intent = ps.getIntent();
try {
Drawable iconFromIntent = c.getPackageManager().getActivityIcon(intent);
ps.setIcon(iconFromIntent);
} catch (PackageManager.NameNotFoundException e) {
Map<Preference, PreferenceScreen> preferenceParentTree = buildPreferenceParentTree();
PreferenceScreen preferenceParent = preferenceParentTree.get(ps);
preferenceParent.removePreference(ps);
}
}
/*Initiate icon view for preferences with keys that are interpreted as Intent
*For more info see OnPreferenceClick method*/
if (ps.getKey() != null) {
if (ps.getKey().contains(".")) {
int lastDot = ps.getKey().lastIndexOf(".");
String pkgName = ps.getKey().substring(0, lastDot);
try {
//if application package exists, we will set the icon successfully
Drawable icon = c.getPackageManager().getApplicationIcon(pkgName);
ps.setIcon(icon);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
/*In case of exception, icon will not be set and we will remove the preference to avoid crashes on clicks
*To find the parent for each preference screen we use HashMap to build the parent tree*/
Map<Preference, PreferenceScreen> preferenceParentTree = buildPreferenceParentTree();
PreferenceScreen preferenceParent = preferenceParentTree.get(ps);
preferenceParent.removePreference(ps);
}
}
}[/COLOR]
for (int i = 0; i < ps.getPreferenceCount(); i++) {
Preference p1 = ps.getPreference(i);
if (p1 instanceof PreferenceScreen) {
/*As we descend further on a preference tree, if we meet another PreferenceScreen, we repeat the allGroups method.
*This method will loop untill we don't have nested screeens anymore.*/
allGroups(p1);
}
}
}
public void allGroups(Preference p) {
PreferenceScreen ps = (PreferenceScreen) p;
ps.setOnPreferenceClickListener(this);
for (int i = 0; i < ps.getPreferenceCount(); i++) {
Preference p1 = ps.getPreference(i);
if (p1 instanceof PreferenceScreen) {
/*As we descend further on a preference tree, if we meet another PreferenceScreen, we repeat the allGroups method.
*This method will loop until we don't have nested screens anymore.*/
allGroups(p1);
}
}
}