Android - setting style programmatically to dynamicly created compound components? - General Questions and Answers

Im posting it here I cannot post in android developers forum.
I have following problem:
I have created compound component for irrelevant to the question purpose. I have also made a pretty nice style for it. While I apply the style in xml (using style="(at)style/xxx") it works flawlessly...
The problem starts when I need to dynamically create list of those compound components... simple call to:
new SubClassOfRelativeLayout(getContext(),null,R.style.xxx) does not give ANY effect.
So my question is as follows: do you, by any chance, know how to apply style (defined in xml resource file) to compound (custom) components that are subclass of RelativeLayout dynamically?

I started using
Code:
TypedArray array = getContext().obtainStyledAttributes(styleID, attributeIDArray);
and applying style manually - it is pain in *** but I have no idea how to do it other way ;/.

AzrealNimer said:
I started using
Code:
TypedArray array = getContext().obtainStyledAttributes(styleID, attributeIDArray);
and applying style manually - it is pain in *** but I have no idea how to do it other way ;/.
Click to expand...
Click to collapse
An old thread, but if you need to get that attributeIDArray, you can do it like this:
Code:
XmlPullParser parser = getResources().getLayout(R.layout.view_layout);
AttributeSet attributes = Xml.asAttributeSet(parser);

Related

Timescape themes (Update for 2.1)

For 2.1 themes see post #17 on page 2: http://forum.xda-developers.com/showpost.php?p=9049613&postcount=17
I decided to open a thread to share the knowledge I have collected on timescape themes. This also partially applies to mediascape and up until now has been split between these two threads:
http://forum.xda-developers.com/showthread.php?t=737778&page=46
http://forum.xda-developers.com/showthread.php?t=765686 Please read this!
I thought it would be better to combine this into one thread that will be easier to find. If anyone disagrees then please post with reasons and alternatives. I will update this first post as we figure out more tweeks etc. (hopefully it will need a big rework soon because SE finally gets us 2.1 )
Before I start, thanks to Chewitt for finding the acet files, and for inspiring me to start messing with the look of my x10 with his Dark10 themes.
Timescape (and mediascape) do not store all of their images in the .apk resources. Oh no, that would just be too logical, and we are talking about Sony Ericsson here
The timescape theme .apk resources do contain some of the images used (e.g. the trash can and app drawer handles), and the actual Timescape .apk has the resources for the tile images etc. I'm not going to go into this as there is enough content about modifying these sorts of resources here. What I will go into is where the timescape background, wave animation, pagination slider colours and the tile alpha blending and default colours.
1. The background: This is stored in an .acet file (see the first of the above posts). This is an file that basically just contains a samll header and then rgb information (or sometimes argb, this is specified in the header which I haven't got 100% sussed yet). The background images are in the assets/ts folder in the theme .apk and are called ts_bg_app.acet and ts_bg_home.acet for the application and timescape home respectively. These can be modified with acetConverter.exe. You can load an image and export an acet file or you can go the other way. TS uses acet backgrounds without an alpha channel so leave the alpha checkbox unticked when creating them (it might work with alpha... never tried...).
2. The Tiles: I'm pretty sure the alpha blend images for the tiles are found in the system/usr/semc/seee/files folder (alpha_tile.acet and alpha_tile_fade*.acet) but I haven't modified these yet. As an aside the background for the first page of mediascape is here too. More important is the default background for a tile. This file, ts_tile_empty.acet, is a single pixel file found in the assets/ts folder for each theme. This specifies the solid colour to be used as a background for the alpha overlay on empty tiles.
3. Animation files: Wave and Pagination. This is all stored in three .afx java animation files in the themes assets/ts folder (ts_bg_wave.afx, pagination_glow.afx and pagination_area.afx). pagination_area is the square around the selected item in the scroll menu at the bottom (or the top if TS is the home page) and pagination_glow defines the lines at the top and bottom of this area. I haven't got these files fully sussed either, at the moment I'm restricted to doing some awful byte replacement to change the color (I can also change the wave pitch, but it doesn't look any good). I have attached an exe to generate these files (SetTimescapeAnimationColor.exe). Click on the white square to choose a base color and use the buttons to generate whichever of the files you want. If anyone knows how to edit these files properly please let me know, I come from a c# and c++ background and don't really know what I'm doing with java...
Thats pretty much it. Just sort out 6 files, update the png resources (the thumbnails for the theme selection are in the Timescape.apk resources folder) and you're done.
Note: I have had problems when I modified the wrong bytes in the afx files. Basically, after selecting the theme timescape just crashed. If you replace the theme file it still won't start, you need to clear the application data to get it running again. Along the same lines, after modifying a theme you need to reselect it from the themes menu as the files are cached.
Please let me know if I missed anything.
Update: I have attached the source code for the animation color tool. Please keep in mind that this was just a bit of code quickly thrown together so we can modify the animation color, I don't usually write code that looks like that
The project is a C# project from visual studio 2010 but the meat of it is in MainForm.cs so just open that if you use a different language/dev environment.
Here is the code from one of the buttons. Resources.pagination_glow is a byte array from an embedded resource (pagination_glow.afx).
Code:
string r = string.Format("{0:000}", (int)(((double)colorPanel.BackColor.R / 255.0) * 100));
string g = string.Format("{0:000}", (int)(((double)colorPanel.BackColor.G / 255.0) * 100));
string b = string.Format("{0:000}", (int)(((double)colorPanel.BackColor.B / 255.0) * 100));
byte[] bytes = new byte[Resources.pagination_glow.Length];
Array.Copy(Resources.pagination_glow, bytes, Resources.pagination_glow.Length);
bytes[949] = (byte)r[0];
bytes[950] = (byte)'.';
bytes[951] = (byte)r[1];
bytes[952] = (byte)r[2];
bytes[953] = (byte)',';
bytes[954] = (byte)g[0];
bytes[955] = (byte)'.';
bytes[956] = (byte)g[1];
bytes[957] = (byte)g[2];
bytes[958] = (byte)',';
bytes[959] = (byte)b[0];
bytes[960] = (byte)'.';
bytes[961] = (byte)b[1];
bytes[962] = (byte)b[2];
bytes[963] = (byte)',';
using (FileStream stream = new FileStream(saveDialog.FileName, FileMode.Create))
{
stream.Write(bytes, 0, bytes.Length);
}
What is important to note is that the embedded afx resources came from the orange theme, the other themes will require different offsets for the byte modification. I'm not sure why the different themes have different code here, I haven't looked closely at the wave animation code for each theme so there may only be a difference there, or there could just be one more space here and there in the preceeding lines or four spaces instead of a single byte tab ('\t')...
Anyway, the next step is to try and modify the number of bytes in the code and see if it still works, on my first few tests timescape just crashed so I thought that the number of bytes of clear-text code may be stored in the header. I'm not so sure now as I think I may have just been having problems while mixing the use of the .Net stream classes for reading an writing. I'll check this out though.
If we can modify the code however we want then I just need to learn a bit more java
The code for the wave animation is in the comments at the bottom of MainForm.cs. Here is the line with the characters being modified in bold:
fcolor.rgb = vec3(1.0, 0.91, 0.72) * ambientRatio + vec3(1.0, 0.516, 0.0) * specularRatio;
LOL this is just lazy lol, Thanks for the guide i will get the other 3 i need for Dark10 sorted on sunday.
this all sounds awesome =)
May I suggest posting the source code to your .exe files? that way others can pitch in and help improve the tools, too. slap on the GPL for a decent licence and it should be no problem
ttxdragon said:
this all sounds awesome =)
May I suggest posting the source code to your .exe files? that way others can pitch in and help improve the tools, too. slap on the GPL for a decent licence and it should be no problem
Click to expand...
Click to collapse
Good idea I have just updated the first post. I have only added the animation tool source as the .acet converter is just a direct color translation except for the header which is post in the acet thread linked in the first post.
I can post this code as well if anyone is really interested, but it will have to wait until I am back at work on the 14th, or until the VPN starts working again
VPN's up - posted the rest of the source.
calum.. just got a new charger today lol so back on track.. although some reason i cant seem to get my colour to change at al? ive rebooted, tried task managers n al but no luck..
Edit: ignore that.. managed to get it working! like an idiot i forgot to add the code at the top for mount/remount lol.. feel like a blonde
Has anyone got an original version of ms_bg_background_home_icn.acet?
Being the genius that I am, I tried to edit it without backing it up first.
I tried to convert a png image to an acet file using that acet converter but ended up with a background with a similar issue to what's in this post. Will read through all the posts tomorrow and try again.
Hey buddy any more progress with this project?
Sorry, on the road at the moment. I'll be back onto this next week.
@Mobzter: glad you got it sorted.
@Sixpence: you may have exported the image with the alpha channel. Make sure the alpha option is off for the timescape and mediascape backgrounds. I'll add complete backups to the first post next week
heres a backup of that file
_calum_ said:
@Sixpence: you may have exported the image with the alpha channel. Make sure the alpha option is off for the timescape and mediascape backgrounds. I'll add complete backups to the first post next week
Click to expand...
Click to collapse
Ah, yeh, I think that's what I did. I'll try again and see how I go. Cheers!
Thanks for backup Mobz!
EDIT: Sweet, that worked!
I just thought I'd post a link to my dark Timescape theme here.
Timescape (Dark)
If anyone else has got any modified timescape themes please post them (including the modified framework and thumbnail images). It would be nice if we didn't just all modify the Indigo them (as I did above) as if we use neutral images for the default contacts etc. then we can easily change between the different themes.
Any interest
Just a bump to see if anyone is interested in doing anything with the Timescape animation except changing the color.
If they are then I might get back into modifying the .afx files, otherwise I'll probably just move on....
I don't actually use it that much and now I've got rid of the blue I'm sorta happy, but it might be kinda cool if we can add our own animations to replace the wave...
How about the mediascape animation? I wanna make it melt into the next screen. Do u think that's doable?
How can i chnge theme for x10i
Sent from my X10i using XDA App
gavriel18 said:
How about the mediascape animation? I wanna make it melt into the next screen. Do u think that's doable?
Click to expand...
Click to collapse
Do you mean instead of the spline/fade animation when you hit the 'more' button? I think a melting animation would be pretty ambitious and probably only doable if the fade is actually part of the animation. I'll see if I can get an editor slapped together so we can just modify the afx code directly. I'll have a look at the mediascape animation files once I've got that done...
xian08 said:
How can i chnge theme for x10i
Click to expand...
Click to collapse
Sorry, I need a bit more information here. Where exactly are you stuck? Do you just want to install a different theme that you have from one of the x10 themes in another forum, or do you want to create you own?
That's exactly what I was thinking, a melt to a fade into the next screen.
I'm trying to understand how it works but i don't have enough spare time right now.
OK, 2.1 is here and the file formats for timescape themes have changed...
First off, the apk names have changed. They are now named like this:
TimescapeLargeUITheme[ThemeName].apk (e.g. TimescapeLargeUIThemeSakura)
The .acet files are now .uxraw files. The file header and content has also changed: the header is now 8 bytes, that can be split into 4 16bit integers. The first two I'm not sure about, (second one always seems to be 8...) but the 3rd and 4th are width and height respectively. After the header we still have the color info, but it seems that alpha is always included. The bytes are in the order R G B A (the alpha is now the 4th byte instead of the first).
I have attached the new converter and source.
Edit: I originally wrote an incorrect value for the first byte in the header (20 instead of 0x20... oops ) this resulted in a black background...
The afx files have also changed to uxsh. There seems to be a bit more in these files but the animation code is still in plain text. I'm working on an editor, and will update this post when it's done.
2.1 or 1.6 ?
Is this for 2.1 or 1.6 ?
Looks a silly question... But, am little cautious and more excited to see this on my 2.1update1.
Thx for such a great work.
_calum_ said:
OK, 2.1 is here and the file formats for timescape themes have changed...
Click to expand...
Click to collapse
mitalbr said:
Is this for 2.1 or 1.6 ?
Click to expand...
Click to collapse
2.1 (I had also changed the thread title to make this clearer )
_calum_ said:
2.1 (I had also changed the thread title to make this clearer )
Click to expand...
Click to collapse
I was just adb'ed the file system and I found I have following files...
TimescapeLargeUI.apk
TimescapeLargeUIThemeBlue.apk
TimescapeLargeUIThemeGreen.apk
TimescapeLargeUIThemeIndigo.apk
TimescapeLargeUIThemeOrange.apk
TimescapeLargeUIThemeSakura.apk
TimescapePluginManager.apk
I couldn't locate...
Timescape.apk
TimescapeThemeIndigo.apk

[Q] Android: Graphical Problems with headers and first views on a ListFragment

I've made an app that has a file browser on the side based of a ListFragment. I've created a custom View called IconTextView which is Basically a linear layout with a drawable for an icon and a text view for text. I also created it's adapter. I use the fragment as a file browser, the user selects a file and sends the string back to the main activity to do something with that file. For reference the class that implements the ListFragment is called FileBrowser.
This is my problem:
In the onCreate() method of FileBrowser First I add two Headers to the ListView Then I set the root directory of my application (which is a Specific Folder of the memory card) to generate the first file list.
While using the app: When the user then touches a folder I browse to it by generating the file list and setting my custom adapter again. What happens here is that the background still retains the original file list. It is obviously inactive but it is there kind of like a wallpaper and it is like the new list in front of it is transparent and the old list is the background. It works just fine, but it looks horrible. I've tried setting the original folder to multiple different folders but it is the same. Also when I scroll the file list, it goes behind the two stationary headers I mentioned.
The work around I found was to set the adapter in the OnCreate Method to null and simply press a button to show the first file list when the application is allready running. This implies that it should be a problem of simply when the setListAdapter is called for the first time. I've tried in the onResume() but the same thing happens. Even with this solution when I scroll the list of items it still goes behind the headers I mentioned just like before.
What I would like to know is if has anyone encountered this before and has found a way to solve it?
Thank you very much for all the help.
PD: The I just realized something else, the color of the headers I define is a custom color with an alpha value. Could it be that the non default alpha value creates the translucency problem?

[Q]First application

Hi guys, i want to do a very simple app for WP7.
It's my first app, so i'm very noob
I put a butto, and i want that when i click on it, it opens a picture.
How i can do that?
There is a guide for noob like me?
you might probably wanna check the guide from Microsoft student..
Please try this out an see if it works. This is using a default empty silverlight project.
In the designer (MainPage.xaml), add a button and an Image element using the XAML:
<Button Name="testButton" Width="140" Height="100" VerticalAlignment="Top" Click="testButton_Click">Open</Button>
<Image Name="imageElement" Width="300" Height="300"></Image>
This should be added inside the Grid Element named "ContentPanel"
Next add the image to your project by right clicking your project in the solution explorer and selecting:
Add -> Existing Item -> And add an image called "test-image.png"
Click on the added image, in the Properties box, set Build Action -> Copy Always
In the code-behind file (MainPage.xaml.cs), add the reference to the library BitmapImage by adding "using System.Windows.Media.Imaging;" to the top of the file.
Add a click event handler for the button using the code:
private void testButton_Click(object sender, RoutedEventArgs e)
{
Uri imageUri = new Uri("/[ProjectName];component/test-image.png", UriKind.Relative);
BitmapImage testImageBitmap = new BitmapImage(imageUri);
this.imageElement.Source = testImageBitmap;
}
But make sure to replace [ProjectName] with the name of your windows phone project.

[MOD][GUIDE] Setting up a custom settings tab

This tutorial is not the conventional type but more like a one way discussion for those familiar with decompiling/recompiling and the basic file structure of JARs and APKs.
So recently I have decided to take steps to minimize the effort involved in setting up new mods. Call me lazy, but it just seemed to make sense. Let me explain what I mean by that. The way I like to think about creating mods is that you have three pieces of the pie.
XML Settings
This is where you set up your toggles and/or list preferences as well as your strings and other attributes needed within your XML files. Located in SecSettings.apk
Smali Settings
This is the code behind the XML that allows the toggles to function. This code determines the true/false of toggles(Bools) as well as the values given to selections when there are more then two options (List preferences). Located in SecSettings.apk
Logic Code
This is the code that checks for preset values (set by your smali settings code) and performs actions based on those preset settings. The logic code is found in what ever smali you happen to be manipulating. If you wanted to change battery options, you would be working in BatteryController.smali, clock options would be clock.smali, etc.
So my goal was to eliminate 2 out of three of those steps by creating my own custom settings tab where I could develop my own XML code as well as my own smali code that would never be changed by android updates. The only time this code would change is when I change it. So now all you need to do is deal with the third piece of the pie, piece one and two are controlled now by you!
So here are the steps to setting up a custom tab within Androids settings menu.
We will be working within SecSettings only for this tutorial.
Navigate to res/xml/settings_headers.xml
Here is where you will set up your new tab. Have a look at one of the lines of code in this XML
Code:
<header android:icon="@drawable/ic_settings_display" android:id="@id/display_settings" android:title="@string/display_settings" android:fragment="com.android.settings.DisplaySettings" />
header android:icon="@drawable/ic_settings_display = The icon you see in the tab and the location that icon is stored
android:id="@id/display_settings" = Android ID thats stored in res/values/id's
android:title="@string/display_settings" = The title the new tab is given located in res/values/strings
android:fragment="com.android.settings.DisplaySettings" = points to the smali that controls this tab
So now create your own tab code based off of the example above.
Create your own icon.png ( size 50 x 50) and drop it in res/drawable-xhdpi.
Add the newly created lines to strings and ID's respectively
Now its time to create an XML file. Your XML file should have a similar name to the smali file you just created the name of above. Dont worry yet about actually creating the smali, just the name for now is fine. So if you named your smali something like RomControl.smali you should name your XML rom_control.xml. So its easy to identify they are related.
Your XML can be as simple as one checkbox or very involved. My suggestion is you start simple and build it out as you get it functional. An XML file with one checkbox would look like this.
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/rom_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings.didact">
<CheckBoxPreference android:title="@string/enable_lockscreen_torch" android:key="enable_lockscreen_torch" android:summary="@string/enable_lockscreen_torch_text" />
</PreferenceScreen>[/hide]
You will need to add the necassary lines to res/strings found in the XML.
You will need to add the XML reference to res/public as well. If your XML is called new_tab.xml you would need to add the following line to res/public
Code:
<public type="xml" name="new_tab" id="0x7f070082" />
The ID would be whatever number is next in the list. This ID also needs to be added to the OnCreate method of your new smali file.
Now its time to create your smali file. I am not going to take this time to explain how to make this file but I will attach what i call a "blank" smali file that will allow what ever XML file you create to be visible. It wont be funtional until the smali gets correctly coded but maybe we can attack that task some other time.
So for now you have added a new line to settings_header.xml
You have added the icon you created to res/drawable-xhdpi
Added the new submissions to strings and IDs
Created your new XML file and put it in rex/xml. We can focus on the structure and coding of an XML file in another post later.
Created your new "Blank" smali. and put it in the folder of your choice
You should now be able to open settings and see your new tab with icon (see photo attached).
It took some work to get here, but now you have secured your code on the SecSettings side and you wont have to worry about updates changing it!
Now its time to code the smali and get the new tab functional...........
No matter what device you get next, I'm coming with you...thanks!
Edit:
Are we required to use your avatar as the icon?
Edit 2:
If I understand this correctly, this guide will simply create a non-functional menu setting with a placeholder smali file.
So, the example you have shown with the lockscreen torch will not actually work, correct?

			
				
You are one of the true developers here on xda didact!! Thank you for your continued dedication!!!
Guys I appreciate the kind words. I just enjoy contributing what i can and when I can. To all those that have been PM'ing me I will try to get back with you as soon as I can. I am just a bit overwhelmed right now.
Working on some new stuff and hope to get it out to you guys by the weekend if all goes smooth.
you really are godly lol!
I think that you are now my favourite dev!
You have save me a lot of effort..
Waiting for your next tutorial man about smali coding :good:
You are a machine. I'm convinced you are not human...
[email protected]'$ [email protected]@XY
Originally Posted by My Wife
You spent the last three days on the laptop for what reasn? So you could make the clock on your phone disappear? That's Brilliant sweetie
hahaha....that´s good mate...welocme in the club..... when i show it to my wife she started to laugh an she told me...
"god... you are not the only one doing that kind of weird things on your phone"
hahahaha... that´s good one
I'm having issues with this mod. First, I made the xml with options and put with the blank smali. Then the options were showed in the settings menu. But when I add the code to the smali file, I get an FC. Here's the logcat I think related with the smali:
Code:
W/dalvikvm(7519): VFY: register1 v1 type 1109890336, wanted 17
W/dalvikvm(7519): VFY: rejecting opcode 0x6e at 0x002e
W/dalvikvm(7519): VFY: rejected Lcom/android/settings/phdsettings;.onCreate (Landroid/os/Bundle;)V
W/dalvikvm(7519): Verifier rejected class Lcom/android/settings/phdsettings;
W/dalvikvm(7519): Class init failed in newInstance call (Lcom/android/settings/phdsettings;)
D/AndroidRuntime(7519): Shutting down VM
W/dalvikvm(7519): threadid=1: thread exiting with uncaught exception (group=0x416ea2a0)
E/AndroidRuntime(7519): FATAL EXCEPTION: main
E/AndroidRuntime(7519): java.lang.VerifyError: com/android/settings/phdsettings
E/AndroidRuntime(7519): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime(7519): at java.lang.Class.newInstance(Class.java:1319)
E/AndroidRuntime(7519): at android.app.Fragment.instantiate(Fragment.java:577)
E/AndroidRuntime(7519): at android.preference.PreferenceActivity.switchToHeaderInner(PreferenceActivity.java:1229)
E/AndroidRuntime(7519): at android.preference.PreferenceActivity.switchToHeader(PreferenceActivity.java:1245)
E/AndroidRuntime(7519): at android.preference.PreferenceActivity.onCreate(PreferenceActivity.java:618)
E/AndroidRuntime(7519): at com.android.settings.Settings.onCreate(Settings.java:191)
E/AndroidRuntime(7519): at android.app.Activity.performCreate(Activity.java:5206)
E/AndroidRuntime(7519): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
E/AndroidRuntime(7519): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
E/AndroidRuntime(7519): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
E/AndroidRuntime(7519): at android.app.ActivityThread.access$700(ActivityThread.java:140)
E/AndroidRuntime(7519): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
E/AndroidRuntime(7519): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(7519): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(7519): at android.app.ActivityThread.main(ActivityThread.java:4921)
E/AndroidRuntime(7519): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(7519): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(7519): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
E/AndroidRuntime(7519): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
E/AndroidRuntime(7519): at dalvik.system.NativeStart.main(Native Method)
Any help? Thanks!
Hi this is brilliant. .will you be adding how to get the smali working for this aswell? Would just finish it off...thanks a lot for your hard work
Sent from my GT-I9300 using xda premium
???
Where to put smali file, i get 3 folders under smali section, i.e android, com, javax
luckydogra said:
Where to put smali file, i get 3 folders under smali section, i.e android, com, javax
Click to expand...
Click to collapse
You have to put in com folder, but inside the other folders. Search, for example, DisplaySettings.smali and put your smali in this folder.
Works great,,, Thanks @Didact74 :laugh:
Here are screenshots of what I have achieved till now..
If you like, I can contribute by giving the smali part explanation about how to add checkbox switches for the RomSetings.smali if I succeed doing so.. of course, it will not be as perfect as our teacher,,
THANKS AGAIN,,
Edit:
Succeed to have full working ROM controller,, Thanks again @Didact74 :laugh:
majdinj said:
Works great,,, Thanks @Didact74 :laugh:
Here are screenshots of what I have achieved till now..
If you like, I can contribute by giving the smali part explanation about how to add checkbox switches for the RomSetings.smali if I succeed doing so.. of course, it will not be as perfect as our teacher,,
THANKS AGAIN,,
Edit:
Succeed to have full working ROM controller,, Thanks again @Didact74 :laugh:
Click to expand...
Click to collapse
Nice majdini!
While I am trying to compile I face this error:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools\APK-Multi-Tool repacked by majdinj - Nov 2012\other\..\projects\SecSettings.apk\res\values\public.xml:1445: error: Public resource xml/rom_control has conflicting type codes for its public identifiers (0x7 vs 0x12).
Anybody can help me out please.
Thanks
kmokhtar79 said:
Nice majdini!
While I am trying to compile I face this error:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools\APK-Multi-Tool repacked by majdinj - Nov 2012\other\..\projects\SecSettings.apk\res\values\public.xml:1445: error: Public resource xml/rom_control has conflicting type codes for its public identifiers (0x7 vs 0x12).
Anybody can help me out please.
Thanks
Click to expand...
Click to collapse
I think you use id (rom_control) in settings_header.xml same as rom_control.xml which makes conflict
majdinj said:
Works great,,, Thanks @Didact74 :laugh:
Here are screenshots of what I have achieved till now..
If you like, I can contribute by giving the smali part explanation about how to add checkbox switches for the RomSetings.smali if I succeed doing so.. of course, it will not be as perfect as our teacher,,
THANKS AGAIN,,
Edit:
Succeed to have full working ROM controller,, Thanks again @Didact74 :laugh:
Click to expand...
Click to collapse
Nice work. If you could add the smali but that would be great help for me. Thanks
Sent from my GT-I9505G using XDA Premium 4 mobile app
alvin551 said:
Nice work. If you could add the smali but that would be great help for me. Thanks
Sent from my GT-I9505G using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Here is all files that I used to create my ROM controller in SecSettings.apk,, I put some details, so you should be fine of what to do
Cheers,,
majdinj said:
Here is all files that I used to create my ROM controller in SecSettings.apk,, I put some details, so you should be fine of what to do
Cheers,,
Click to expand...
Click to collapse
Thanks a lot. I'll have a look when I have time
Sent from my GT-I9505G using XDA Premium 4 mobile app

[APP][For XDA devs][Sample Wallpaper chooser for rom devs]

HI ... !
I was looking for this stuff since ever and didn't find anything like it so I decided to share it here (sharing is caring ) because I know how painful it is to make apps from ground up and many rom devs have experience with smali but not with java and fear dealing with eclipse and android-studio
*NOTE : THIS PROJECT IS PROVIDED AS IS NO lICENSES AND IS OPEN SOURCE AND THERE ISNT ANYTHING PREVENTING YOU FROM USING THIS APP JUST MENTION ME WITH A SMALL SUPPORT BANNER WITH A REFERENCE TO THIS THREAD*
What is this project ?
This is a wallpaper chooser/picker in a gridview + nav drawer + material style so it looks damn cool in a red scheme .
Libraries used :
v7 appcompact --> material stuff
v4 support library --> grid elements etc ...
ikimuhendis:ldrawer by ikimuhendis ---> for nav drawer arrow
Source :
https://github.com/hashem78/APP_SAMPLEWALLPAPERCHOOSER
How to build :
You need a gradle based compile ide to build the app
IDE of choice -> android studio (intellij)
to build using android studio (assuming you have the source downloaded)--> 1. make sure you have android studio downloaded and setup properly having google support libraries downloaded and linked to your ide
2. File --> import --> choose the path of the app
3. Make your changes if you want (skip if not needed)
4. Build ---> make project
5. make a signutare and set your out location
done
Project structure :
build.gradle --> it has the local packages name of the app and libraries included also controls build tools version and sdk version and other things
app/src/main --> res folder (where the styles , strings , values and images are stored)
AndroidManifest.xml (class and activity definitions plus controling app wide theme)
app/src/main/java/mythi/samplewallpaperchooser/widget --> CustomDrawerLayout (the name tells it)
app/src/main/java/mythi/samplewallpaperchooser/ --> FullScreenImageActivity (activity class to display from resolution image when user clicks from grid view)
MainActivity --> (name tells it)
Sample --> (example class where you inflate the main activity view from)
SampleImageAdater --> (example class where you call your image resources)
so assuming you want to modify the app you have to
1. got to res/values/strings.xml change app_name refernce to what ever you want
2. add image resources to res/drawable-nodpi
3. change SampleImageAdapter definitions according to your needs
voila !
Credits :
Dave from stackoverflow
ikimuhendis for sliding drawer arrow
Google for support libraries
Xda
MerkMod team
todo :
design this thread
nothing ? anything ?
Sample app download . can be smalied and backsmalied
Bump ?
Good lookin sharing this brother

Categories

Resources