[Q] [Help] Flashlight Notification Widget Cm 7.2 - Samsung Galaxy Mini

Hello everyone,
i would like to know, if anyone has managed to get the flashlight from the notification widget working on a CM 7.2 based Rom.
In the official build this option is greyed out, i guess because it is not fully working. Anyway i would love to enable this to grab a logcat and try to fix the remaining issues.
My Problem is, when enabling the button I change some xml code and as far as I know, I would have to resign all my System apps, to reinstall Settings.apk. I might be wrong with all this, just started to understand Android…
Anyway, what I have done is decompile Settings.apk and took a look at:
xxx:\Settings\res\layout\widget_settings.xml
……………………………
<LinearLayout androidadding="6.0dip" android:layout_width="fill_parent" android:layout_height="?android:listPreferredItemHeight"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout androidrientation="vertical" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<TextView android:textSize="20.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="0.0dip" android:text="@string/toggleFlashlight" android:layout_weight="1.0" />
<TextView android:textSize="14.0dip" android:textColor="#ff808080" android:layout_width="fill_parent" android:layout_height="0.0dip" android:text="@string/toggleFlashlightDescription" android:singleLine="true" android:layout_weight="1.0" />
</LinearLayout>
<CheckBox android:id="@id/toggleFlashlight" android:layout_width="wrap_content" android:layout_height="wrap_content" android:checked="true" />
</LinearLayout>
……………………………
Click to expand...
Click to collapse
Interessting is Line 181, where a android:checked="true" is missing to “ungray” the button. That is my guess anyway…
I also found, that the “toggleflashlight” event includes an app package called net.cactii.flash2. This app is called Nexus Torch. I’m pretty sure, this is just for real flashlights and not LED flashlight.
You can find this reference in:
xxx:\Settings\smali\com\android\settings\widget\SettingsAppWidgetProvider.smali
That is how far I have got with this and unfortunately, I’m kind of stuck at this point…
Any help would be greatly appreciated
Cheers
Wooaarr

there's no flashlight in the mobile
it is not working that's why it grayed out in official builds
and in unofficial build it is not grayed out because no one thought about it

Hello dheeraj (dhlalit11),
thank you for your reply.
I think you miss understood me. I know that there is no flashlight in this mobile. What i want to do, is get the Screen on, on full Brightness with a white background.
This code is already implemented, so i dont really understand why that option is greyed out anyway. It would work similar to Lidroids statusbar toggles.
If Flashlight available use it, if not turn on Screen with full Brightness.
Cheers
Wooaarr

I think checked code is there to make it check(selected) by default after a factory reset(i think you have got what I want to explain)
and to make it ungray/usable you can use the code used in unofficial builds
to make the brightness go up at max you can use the brightness toggle codes

Thank you again
You are right about the android:checked="true" thing. To enable it, there should somewhere be a setEnable, which i can not find unfortunatly...
Anyway, could you give me a hint about which Unofficial builds you are talking? I can't remember trying a Cm 7.2 based Rom, which had this feature enabled.
Thank you in advance
Wooaarr

forget
i can recall that i had read "do not use flashlight toggle or you will have problems" something like that in a rom's thread
you can try looking into stock based roms like emanon, more etc. or those roms which uses lidroid toggles

dheeraj (dhlalit11) said:
"do not use flashlight toggle or you will have problems"
Click to expand...
Click to collapse
That is what i read as well, but there is nothing that can't be fixed
Most Stock Based Roms include a little modification of lidroids toggle, so this won't help me that much, because there is quite a big difference between Cm toggles and lidroids.
Never the less i will dig into all this, thank you for your time
Wooaarr

try android:enable="true" />

I just can't ungray the button...
A Android:checked does not make it checked, nor does a android:enable make it clickable...
I can't find anything in the smali that would change the buttons appearance, so i guess it must be in the xml.
What am I missing here?

you can modify the code for another toggle which would be much more east to do

Howe true, i did that already
There is still this gray little button freaking me out
Just an esthetic problem, but it just annoys me...

Related

Need help pleasepleaseplease

heya folks, i'm probably waaaay off course here, but i need a small favour from you kind people out there
i need to convert a .xml file to a .csv file... anyone up for it?
the basic layout of the xml is
Code:
<phone name="1100">
<repair name="Broken Screen" price="18.00" />
<repair name="Not Charging" price="21.00" />
<repair name="Microphone Replacement" price="16.00" />
<repair name="Earpiece Replacement" price="16.00" />
<repair name="Loudspeaker Replacement" price="16.00" />
<repair name="Software Faults" price="21.00" />
<repair name="Phone Not Turning On" price="Variable" />
<repair name="Other" price="Variable" />
<repair name="Unlock" price="10.00" />
<repair name="Unlock" price="10.00" />
</phone>
<phone name="1110">
<repair name="Broken Screen" price="18.00" />
<repair name="Not Charging" price="21.00" />
<repair name="Microphone Replacement" price="16.00" />
<repair name="Earpiece Replacement" price="16.00" />
<repair name="Loudspeaker Replacement" price="16.00" />
<repair name="Software Faults" price="21.00" />
<repair name="Phone Not Turning On" price="Variable" />
<repair name="Other" price="Variable" />
<repair name="Unlock" price="10.00" />
</phone>
is it possible to make it so (for example using MS excel) every new phone, is a new row?
sort of like this in notepad...
Code:
,Nokia,1100,broken screen - 18.00,not charging - 21.00,etc ,etc,etc,,,,,,,,,,,,,,,,,,,,,,,,
,nokia,1110,broken screen - 18.00,not charging - 21.00,etc ,etc,etc,,,,,,,,,,,,,,,,,,,,,,,,
the help would be reatly appreciated as i know nothing of programming
thanks in advance peeps
sorry if this is waaay off topic, but it is the off topic section lol
check this.. http://www.ricebridge.com/xml-csv-convert.htm
also try.. http://tinyurl.com/l89gzl
jor3l said:
check this.. http://www.ricebridge.com/xml-csv-convert.htm
also try.. http://tinyurl.com/l89gzl
Click to expand...
Click to collapse
thanks for the help, but unfortunately i already went to that page, and the google search was identical to mine earlier lol
thanks for trying tho

[MOD] Hidden Notification Music Controls ** MoDaCo R4 Support **

Hi everyone,
Update 31/03: Works with all 2.2.2 ROM's, including the awesome MoDaCo kitchen!
For me the notification controls for the music player are an admirable idea but ultimately useless if you don't prefer the stock music player. It would be ideal if any music player could hook into them but alas, with the current implementation that's not possible.
I found the option to turn these controls off in the Music app to be utterly unreliable. Frequently I would reboot to find the controls visible even though the option was unchecked in the Music app. I also found that if you freeze or remove the Music app the controls become visible again and there is no way to remove them.
So here's the fix:
Modified framework
Actively hides the controls every boot
Music app can be removed, controls remain hidden
All I have done is add the following code to framework-res.apk/res/layout/statusbar_expanded.xml in the music controls section.
Code:
android:visibility="gone"
And, since this didn't work for all users, I've now added the following so even if it wants to show it will be 0% high ~hidden.
Code:
android:layout_height="0dip"
Here an update.zip you can flash using Paul's Clockwork Recovery, please make a backup first.
Only tested on P990 with Android 2.2.2!
DOWNLOAD
Stock LG 2.2.2 ROM or MoDaCo r1, r1, r3 ROMs
Download: O2xNoMusicControls-v2-unsigned.zip (5.4MB)
MD5 Hash: 05090f6d6890f8ba6e1f5145dc46ae9e​
OR
MoDaCo r4+ ROMs
Download: O2xNoMusicControls-v2-MCR-unsigned.zip (5.4MB)
MD5 Hash: 7eb25009d8773e47e886577e2b326a1e​
Enjoy + Thanks = Win
Nice work, but did not make any change for me. Buttons still there if i remove the music.apk
did not work here either :/ really want to get rid of that
DocRambone said:
Nice work, but did not make any change for me. Buttons still there if i remove the music.apk
Click to expand...
Click to collapse
[email protected] said:
did not work here either :/ really want to get rid of that
Click to expand...
Click to collapse
Oh, really?
Well, I'll need to take another look, worked for me...
I'll do that tomorrow, thanks for the heads-up!
djmcnz said:
Oh, really?
Well, I'll need to take another look, worked for me...
I'll do that tomorrow, thanks for the heads-up!
Click to expand...
Click to collapse
I had already deleted the music.apk before I tried this, but I tried it anyway but still it was there, then adb pushed the music.apk back and removed it through settings, but when I deleted the music.apk it was there again so adb push back and now it's gone but I keep the music.apk but hide it with Launcher Pro until this works thanks!
btw this has nothing to do with the music control, but the power widget control (wifi, bluetooth etc) I change my LCD density to 190 from 240 because 240 is way to much and looks bad, but the power widget don't fit the screen if you know what I mean (it fits but there is a little emty at the right side, hard to explain but I think you can test it for yourself it you want too), is it possible to fix it? and another thing, I just want wifi, bluetooth icon there (with my Nexus S CM7 I have wifi, bluetooth and flash but there is no flash atm) is it possible to hack it somehow?
Well it's interesting, I've tested it again and it does work for me with one exception:
* When I activate the shade in landscape mode the music control comes back.
When this happens, because I have removed the Music app, I can't disable it again... But when I reboot it is gone...
So I need to look into the landscape bug... are you using landscape mode at all?
And yes, I think you can alter the toggle buttons... I'll look at that too.
didn't work for me too. The buttons reappears when I delete the music.apk
I've updated it guys, details in the first post, let me know how you get on.
[email protected] said:
btw this has nothing to do with the music control, but the power widget control (wifi, bluetooth etc) I change my LCD density to 190 from 240 because 240 is way to much and looks bad, but the power widget don't fit the screen if you know what I mean (it fits but there is a little emty at the right side, hard to explain but I think you can test it for yourself it you want too), is it possible to fix it? and another thing, I just want wifi, bluetooth icon there (with my Nexus S CM7 I have wifi, bluetooth and flash but there is no flash atm) is it possible to hack it somehow?
Click to expand...
Click to collapse
Yes, this is all possible:
Code:
<TableRow>
<ImageView android:layout_gravity="top" android:id="@id/sound_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginLeft="21.0px" android:layout_marginTop="10.0px" android:layout_marginRight="17.0px" android:layout_marginBottom="0.0px" />
<ImageView android:layout_gravity="top" android:id="@id/wifi_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginTop="10.0px" android:layout_marginRight="17.0px" android:layout_marginBottom="0.0px" />
<ImageView android:layout_gravity="top" android:id="@id/bt_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginTop="10.0px" android:layout_marginRight="17.0px" android:layout_marginBottom="0.0px" />
<ImageView android:layout_gravity="top" android:id="@id/gps_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginTop="10.0px" android:layout_marginRight="17.0px" android:layout_marginBottom="0.0px" />
<ImageView android:layout_gravity="top" android:id="@id/switch_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginTop="10.0px" android:layout_marginRight="21.0px" android:layout_marginBottom="0.0px" />
</TableRow>
djmcnz said:
Yes, this is all possible:
Code:
<TableRow>
<ImageView android:layout_gravity="top" android:id="@id/sound_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginLeft="21.0px" android:layout_marginTop="10.0px" android:layout_marginRight="17.0px" android:layout_marginBottom="0.0px" />
<ImageView android:layout_gravity="top" android:id="@id/wifi_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginTop="10.0px" android:layout_marginRight="17.0px" android:layout_marginBottom="0.0px" />
<ImageView android:layout_gravity="top" android:id="@id/bt_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginTop="10.0px" android:layout_marginRight="17.0px" android:layout_marginBottom="0.0px" />
<ImageView android:layout_gravity="top" android:id="@id/gps_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginTop="10.0px" android:layout_marginRight="17.0px" android:layout_marginBottom="0.0px" />
<ImageView android:layout_gravity="top" android:id="@id/switch_button_toggle" android:layout_width="wrap_content" android:layout_height="74.0px" android:layout_marginTop="10.0px" android:layout_marginRight="21.0px" android:layout_marginBottom="0.0px" />
</TableRow>
Click to expand...
Click to collapse
Great, is it something I can do easy or does it take some "time" (maybe you can make a update.zip file)? as I said, I only need Wifi and Bluetooth (flashlight when it's possible, maybe you can make a flashlight button?) and if would be nice if the buttons fills the screen (make them wider) when using density 190
thanks!
Confirmed functional
Thanks .
[email protected] said:
Great, is it something I can do easy or does it take some "time" (maybe you can make a update.zip file)? as I said, I only need Wifi and Bluetooth (flashlight when it's possible, maybe you can make a flashlight button?) and if would be nice if the buttons fills the screen (make them wider) when using density 190
thanks!
Click to expand...
Click to collapse
lol - the problem is the testing... I don't have my density set like that so couldn't test and the changes are very fine-grained which means there would be lots and lots of testing...
It's not hard to change but you need to first understand adb, apktool, framework-res and layout.xml stuff... it's all on the forums though!
If you get up and running with adb and apktool (http://code.google.com/p/android-apktool/ & http://forum.xda-developers.com/showthread.php?t=640592) - verified and tested - then I'll show you where to start making changes.
DocRambone said:
Confirmed functional
Thanks .
Click to expand...
Click to collapse
Thank you kind sir!
djmcnz said:
lol - the problem is the testing... I don't have my density set like that so couldn't test and the changes are very fine-grained which means there would be lots and lots of testing...
It's not hard to change but you need to first understand adb, apktool, framework-res and layout.xml stuff... it's all on the forums though!
If you get up and running with adb and apktool (http://code.google.com/p/android-apktool/ & http://forum.xda-developers.com/showthread.php?t=640592) - verified and tested - then I'll show you where to start making changes.
Click to expand...
Click to collapse
ok, I already have adb, I downloaded apktool and copied the files to the Windows directory, now what?
[email protected] said:
ok, I already have adb, I downloaded apktool and copied the files to the Windows directory, now what?
Click to expand...
Click to collapse
Try and decomplie an apk, recompile it and get it working on your phone. Report back.
Thanks for this fix! Worked like a charm, first installed a custom baked rom from modaco and after this I applied this fix and tadaa no more stupid notification!
I was just thinking about doing this, thank you very much
Woops double
Nice tweak, thanks for sharing!
Let's hope Paul adapts the mod in his custom kitchen
This patch isn't working anymore after the FR4 release. I tried it and it kept rebooting my phone, after installing FR4 without this patch it works like a charm. Is it possible you update it so that it works agan?

App results in blank black screen on android phone....why?

I have removed all the elements from my layout and commented out references to the controls etc that I did have in my layout:
Code:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#0099cc"
tools:context=".HexapodControls"
android:id="@+id/frame_controls"
android:visibility="visible"
android:paddingTop="50dp">
<!-- The primary full-screen view. This can be replaced with whatever view
is needed to present your content, e.g. VideoView, SurfaceView,
TextureView, etc. -->
<!-- This FrameLayout insets its children based on system windows using
android:fitsSystemWindows. -->
</FrameLayout>
So why, when I generate the apk in android studio and install it on my phone, do I get a blank black screen.
I give up! What have I changed to cause this?
Never mind I figured it out.
I commented out this line "setContentView(R.layout.activity_hexapod_controls);"
along with the rest of it.

Magisk Module HELP - Please

Hello guys im trying from long time to understand why Gcam no matter from the version the slow motion never worked on HTC 10 and i think is related to the media_profiles.xml because we miss some important lines in order the Slow Motion to work properly.
Anyway sometimes when the things go wrong and edit manually the Media xml file i can recive a nasty bootlopp and in order to not repeat the same all the times
can anyone who is familiar with Magisc create a simple module?! for test purpose.
This lines to be added to the Media_profiles.xml
No mater from the Buld you know that the Gcam always crash and force close when you switch to Slow Motion
But only with this MOD magisk module
https://forum.xda-developers.com/apps/magisk/module-gcam-patch-t3677993
In every build ive try i was able to switch to Slow Mo without a crash also im able to press the button of recorder and i saw the sign 120 FPS under slow motion the problem is that for now the VIEWER freeze and im not able to record a video.
But this module only add some lines in the media_presets xml so thats why i think we are close and im sure is something related just for the xml file something in our HTC 10 is different in that media profiles xml and we need to find out what exactly!
I think the GCAM cant read the seeting correctly from the XML if they are not corectly set or writen.
for example in my Media profiles by default the SLOW MOTION is missing but this dont preven the Stock HTC CAM to record slow mo maybe we have to add this in order if we want to make GCAM to work as well
If you wish chek your media_profiles.xml do u have something similar i think this is the correct lines that we are missing and have to add this line but because im tired of bootlops if im wrong everytime im looking for methood how to use it like a MODULE and in case something went wrong to be able to revert back to stock.
In the magisk module above some of the lines are incorrect and maybe thats why the view freeze
and think this are the correct we all have to add.
<!-- CAMCORDER_QUALITY_HIGH_SPEED_HIGH/720P : [email protected]; 27.0 Mbps -->
<EncoderProfile quality="highspeedhigh" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="27000000"
width="1280"
height="720"
frameRate="120" />
<!-- audio setting is ignored -->
<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="2" />
</EncoderProfile>
<EncoderProfile quality="highspeed720p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="27000000"
width="1280"
height="720"
frameRate="120" />
<!-- audio setting is ignored -->
<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="2" />
</EncoderProfile>
<!-- CAMCORDER_QUALITY_HIGH_SPEED_HIGH/1080P : [email protected]; 34.0 Mbps -->
<EncoderProfile quality="highspeed1080p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="34000000"
width="1920"
height="1080"
frameRate="60" />
<!-- audio setting is ignored -->
<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="2" />
</EncoderProfile>
I think this is the missing part for the Slow Motion to work properly on HTC 10 and few other devices as well, because we by default don`t have that config in our media profiles.
Will be very thankfull.
Thanks
Hi
I have a xiaomi mi a1 and have the same problem. Even with the module you refered slow motion crashes gcam.
I've tried one other module here https://forum.xda-developers.com/apps/magisk/module-hevc-60fps-slomo-gcam-op3t-5-t3666287 and I can film at 120frames but it's laggy (filming and playing). I think it's because it is specific for those models.
I also would like to try a module that only adds the necessary lines to media_profiles.xml, but I don't know how to do it.
Did you try to talk with the gcam module creator to see if he can try to do one like you describe?
regards

Setting position of ImageView according to an image (dynamic with screen sizes)

Hello,
I learned that to make a bitmap image clickable, I need to assign it to ImageView. However, I am failing to set the position correctly so that it is dynamic with every screensize. It really is not possible to let ImageView locate the bitmap image on the screen and act upon that? I tried so many things but the best I have now is that ImageView creates another image of my button and when I manually change its position, it does not scale properly with other screen sizes.
For example my AdView (visible in xml) scales correctly with other screens but I could not apply the same principles with my button.
I would prefer if ImageView would just take the location of drawn bitmap button on screen but if this is not possible, could you guys please provide me with some example codes of how to correctly set the button generated by ImageView? So that I can move it to desired location and have it the same across different screen sizes.
I HAVE TRIED:
Changing position manually in SurfaceView - doesnt scale properly
Implement app:layout_widthPercent="50%" etc. - doesnt work for me
Implement app:layout_constraintBottom etc. - doesnt work for me
activity_main.xml:
<com.markS.flappykillercrow.GameManager
android:id="@+id/gameManager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/image_button_android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/playbutton"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
/>
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:adSize="BANNER"
app:adUnitId="ca-app-pub-3940256099942544/6300978111"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Thank you very much in advance, this would save my day!

Categories

Resources