[Q] Custom analog clock app - Android Q&A, Help & Troubleshooting

Hi!
I'm quite new to android app development and I need some help. What I want to achieve here is to learn how to take a value and use it as a rotation value for a image.
I have a class ready with a value to implement as the rotation value. It comes from the class Time. And the rotation value = Time.getSec();
classes:
MainActivity.java
Time.java
The image I want to rotate is below with all parameters applied atm.
<ImageView
android:id="@+id/bigSecPointer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="26dp"
android:src="@drawable/big_sec_pointer" />
Kind regards Robin!

Related

android layout xml properties and positioning…

I dont know if this is okay to do but I have a problem and I have discribed it here:
http://stackoverflow.com/questions/9481028/android-layout-xml-properties-and-positioning
Does anybody know how I make this work as I want? you can write your answers here
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Moving to Q&A
Here is an example:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<HorizontalScrollView
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<!-- PLACE HERE YOUR SCROLLABLE CONTENT -->
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBox" />
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RadioButton" />
<!-- END OF SCROLLABLE CONTENT -->
</LinearLayout>
</HorizontalScrollView>
<Button
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="I'm a button"
/>
</LinearLayout>
the android:layout_weight="1" in the HorizontalScrollView pushes the button to the right edge all the time even if there isnt any content...
cgollner said:
Here is an example:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<HorizontalScrollView
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<!-- PLACE HERE YOUR SCROLLABLE CONTENT -->
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBox" />
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RadioButton" />
<!-- END OF SCROLLABLE CONTENT -->
</LinearLayout>
</HorizontalScrollView>
<Button
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="I'm a button"
/>
</LinearLayout>
Click to expand...
Click to collapse
alioooop said:
the android:layout_weight="1" in the HorizontalScrollView pushes the button to the right edge all the time even if there isnt any content...
Click to expand...
Click to collapse
Isn't it what you want?
Sent from my U8800 using xda premium
cgollner said:
Isn't it what you want?
Sent from my U8800 using xda premium
Click to expand...
Click to collapse
No not really... when the content of the scrollview isnt taking the whole screen width I want the button to be at the scrollviews edge. but as soon as the scrollview has so much content that the button will be pushed outside the screen I want that the button will stay at the screens right edge so its always visible like the add tab button in google chrome. if I have one tab the button is right beside that tab but if I have so many that the button will bi pushed outside the screen, it stays at the edge instead. but I want my content to be scrollable instead of making the tabs smaller
do you understand?
alioooop said:
No not really... when the content of the scrollview isnt taking the whole screen width I want the button to be at the scrollviews edge. but as soon as the scrollview has so much content that the button will be pushed outside the screen I want that the button will stay at the screens right edge so its always visible like the add tab button in google chrome. if I have one tab the button is right beside that tab but if I have so many that the button will bi pushed outside the screen, it stays at the edge instead. but I want my content to be scrollable instead of making the tabs smaller
do you understand?
Click to expand...
Click to collapse
Oh, I understand. Unfortunately I don't know how to do that. ScrollView has some strange behavior.
Yes i know... thanks anyway and I really hope someone knows..

[APP - unsolved] - youtube preloading settings

Does anyone know if it is possible to change the preload settings in the new youtube app? I would like the ability to preload a lot more than it currently is.
The youtube.xml had some interesting properties that I think if tweaked would allow for more storage of offline videos. It also had some other interesting properties.
Code:
<long name="prefetch_last_not_used_notification_time" value="1341515076733" />
<boolean name="show_channel_store_turorial" value="false" />
<boolean name="prefetch_watch_later" value="true" />
<boolean name="download_only_while_charging" value="true" />
<int name="transfer_max_connections" value="3" />
<int name="session_summary" value="1" />
<long name="prefetch_last_local_playback_time" value="1342121116028" />
<int name="download_max_rate" value="131072" />
<int name="session_watch_count" value="0" />
<int name="last_ad_delay" value="420000" />
<boolean name="prefetch_subscriptions" value="true" />
<string name="prefetch_quota">512</string>
<boolean name="promo_fullscreen" value="true" />
<long name="last_ad_time" value="1339645854411" />
I think the entry that needs to change is prefetch_quota. I'll be changing mine to 1024 and report back. Another interesting one is transfer_max_connections as well as download_max_rate. The 131072 value for download_max_rate I believe is in bytes or it is also 128kb which aligns with what some other users have noticed.
Thanks.
So after changing the value to 1024 and letting it sit for a night on the charger the file was automatically changed back to 512.
I'm going to try transfer_max_connections and i set mine to 8 next.
I have a feeling 'prefetch_quota' refers to the 'prefetch_subscriptions' line above it. It seems to me that that setting refers to how much to load from your subscriptions, as opposed to buffering a video more before starting to play or preloading more of the general video index.
I'm not sure what you mean by 'preload more than it is', though, so maybe that's what you want.
Good luck.
g
its only for your subscriptions
It still isn't preloading as much as I'd like it too. I'll mess with some more settings over the weekend.
iconeo said:
It still isn't preloading as much as I'd like it too. I'll mess with some more settings over the weekend.
Click to expand...
Click to collapse
Thanks for investigating this. Have you been able to determine which directory or folder Youtube is preloading the cache to?

[app][GB+] beats manager app (sound mod)

well...its been a long time since I've made my last thread. this is an app for you called "beats manager". this app is made to enhance our bass and overall sound quality in our device. it works just like dsp manager. well...it's actually modified dsp manager with beats theme. however, several part of the app has been modified to meet my needs. you'll notice that you have 4 instead of 3 bass strengt setting. you also got more two eq preset and 1 virtual effect preset. long story short.
the link
Beats Manager:
v_0.1 : http://d-h.st/1Zi
v_0.2 : http://www.mediafire.com/?ajajtgghuu0pq4j
v_0.3 : http://www.mediafire.com/?1fqfr06uyrfpwbu
v_0.4 : http://www.mediafire.com/download.php?n46kt5ald2etl2v
note: this app is a modified version of an app I found recently on google play called "equalizer". the original link is https://play.google.com/store/apps/details?id=org.equalizerapp what I do is only rethemed it and rename the app. I didn't take credit for this app and I modify this app only for fun. if you have a lil spare time I hope you could visit their page and give them some appreciation and encouragement.
v_0.5 : http://www.mediafire.com/?a53bukwqayjbof5
based on com.devdnua.equalizer with beats themed version.
v_0.5.1 : http://www.mediafire.com/?s21jwu8js5d33d6
dsp manager for ICS. it doesn't work on GB. I put it here just in case if someone want to use i on ICS.
Miui Player: http://d-h.st/hnf
Click to expand...
Click to collapse
changelog:
Beats Manager
v_0.1 (30-9-12)
- first public release
v_0.2 (1-10-12)
- attempt to fix dynamic compression bug (need tester on stock sgy music player)
v_0.3 (22-10-12)
- complete new app based on an app I found in evanlocked's custom rom
- eq modified.
v_0.3 (27-10-12)
- new base app
- new icon and app name
Miui Player
v_0.1 (30-9-12)
- first public release
Click to expand...
Click to collapse
btw, the new eq setting is- kuro bass (7.5 - 6.0 -1.0 - 3.5 - 4.0), max amp (10-10-10-10-10). you can install this app as an ordinary app. no need to push it to system/app. if you already have dsp manager, you must unistall it before installing this app. for the addition, I included modified miuiplayer which can be installed as ordinary app too. this app is actually intended for GB based rom but it should be working fine on ICS or newer android system version. already tested on my tipo
KNOWN BUG
- v1 and v2 doesn't work with several beats n xloud mod
- v3 lag on slow system.
enjoy...
TERM OF USE AND SHARING:
this thread intent is for sharing. feel free to use, edit, distribute all material inside this thread which came from me. if there any parts of this mod which comes not from me please refer to the original dev I've mentioned in this thread. if want to share it to another forum or modify it you don't have to ask my permission. no need to credits, put links or whatsoever. you'll only need to remember that you should held all the responsibility by using this mod, modify it or distribute it. DO IT WITH YOUR OWN RISK
Click to expand...
Click to collapse
ADDITIONAL STUFF - HOW TO ADD YOUR EQ PRESET AND MODIFY THIS APP
decompile the app usual. the file required to modify is in /res/values. the other files are untouched. under this folder you'll find four xml files
1. arrays
2. public
3. string
4. ids
we didn't touch the last one. now look into array.xml. you'll find
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="headphone_modes"> //this part contain the virtual effect setting
<item>Studio</item>
<item>Room</item>
<item>Large room</item>
<item>Kuros</item> //kuro-this value is added by me to add one more virtual setting
<item>Stage</item>
</string-array>
<string-array name="headphone_modes_values">
<item>0</item>
<item>250</item>
<item>500</item>
<item>750</item> //kuro-this value is added by me to match the addition above
<item>1000</item>
</string-array>
<array name="equalizer_preset_modes"> // this part is the eq preset stuff
<item>@string/eq_preset_acoustic</item>
<item>@string/eq_preset_bass_booster</item>
<item>@string/eq_preset_bass_reducer</item>
<item>@string/eq_preset_classical</item>
<item>@string/eq_preset_deep</item>
<item>@string/eq_preset_flat</item>
<item>@string/eq_preset_r_and_b</item>
<item>@string/eq_preset_rock</item>
<item>@string/eq_preset_small_speakers</item>
<item>@string/eq_preset_treble_booster</item>
<item>@string/eq_preset_treble_reducer</item>
<item>@string/eq_preset_vocal_booster</item>
<item>@string/eq_preset_kuro_max</item> // this one is the eq preset added by me
<item>@string/eq_preset_kuro_bass</item> // this one too
<item>@string/eq_preset_custom</item>
</array>
<string-array name="equalizer_loudness_modes"> // the loudness compensation setting. doesn't have any noticeable effect. lets leave it
<item>Disabled</item>
<item>Weakest</item>
<item>Weaker</item>
<item>Weak</item>
<item>Strong</item>
<item>Stronger</item>
<item>Strongest</item>
</string-array>
<string-array name="equalizer_loudness_values"> // loudness compensation value
<item>10000</item>
<item>5000</item>
<item>4000</item>
<item>3000</item>
<item>2000</item>
<item>1000</item>
<item>0</item>
</string-array>
<string-array name="equalizer_preset_values"> // eq preset value
<item>4.5;3.5;1.75;3.5;2.5;</item>
<item>7.5;6.0;0.0;0.0;0.0;</item>
<item>-6.5;-4.0;0.0;0.0;0.0;</item>
<item>4.0;3.25;-0.5;2.0;3.5;</item>
<item>4.0;0.5;1.5;-4.0;-4.5;</item>
<item>0.0;0.0;0.0;0.0;0.0;</item>
<item>5.5;3.5;-1.75;1.5;2.5;</item>
<item>4.5;2.75;-0.5;2.75;4.0;</item>
<item>6.5;4.0;0.0;-6.5;-4.0;</item>
<item>0.0;0.0;0.0;4.0;6.5;</item>
<item>0.0;0.0;0.0;-6.5;-4.0;</item>
<item>-2.5;0.0;3.5;1.5;-2.0;</item>
<item>10.0;10.0;10.0;10.;10.0;</item> // this part is added to match the EQ stuff above
<item>7.5;6.0;1.0;3.5;4.5;</item> // this one too :P - max value is 10 to -10. don't forget the sequences!! the first one is - max amp, then - kuro bass if you add more eq preset you should remember their position in <array name="equalizer_preset_modes">
<item>-1337</item>
</string-array>
<string-array name="compression_modes"> // dynamic compression. only works on stock player. it's buggy. so let this one untouched
<item>Low</item>
<item>Medium</item>
<item>High</item>
</string-array>
<string-array name="compression_modes_values">
<item>50</item>
<item>100</item>
<item>300</item>
</string-array>
<string-array name="bassboost_modes"> // the amazing bass boost
<item>Low</item>
<item>Medium</item>
<item>High</item>
<item>X-tra</item> // this one is added by me
</string-array>
<string-array name="bassboost_modes_values">
<item>0</item>
<item>333</item>
<item>666</item>
<item>1000</item> // this one is added to match the modification above. max value is 1000. you can't add something higher than this but you still could add more variable setting on it.
</string-array>
</resources>
now open you public.xml. we need to register our eq preset here
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="drawable" name="icon" id="0x7f020000" />
<public type="layout" name="equalizer" id="0x7f030000" />
<public type="layout" name="equalizer_popup" id="0x7f030001" />
<public type="xml" name="bluetooth_preferences" id="0x7f040000" />
<public type="xml" name="headset_preferences" id="0x7f040001" />
<public type="xml" name="main_preferences" id="0x7f040002" />
<public type="xml" name="speaker_preferences" id="0x7f040003" />
<public type="array" name="headphone_modes" id="0x7f050000" />
<public type="array" name="headphone_modes_values" id="0x7f050001" />
<public type="array" name="equalizer_preset_modes" id="0x7f050002" />
<public type="array" name="equalizer_loudness_modes" id="0x7f050003" />
<public type="array" name="equalizer_loudness_values" id="0x7f050004" />
<public type="array" name="equalizer_preset_values" id="0x7f050005" />
<public type="array" name="compression_modes" id="0x7f050006" />
<public type="array" name="compression_modes_values" id="0x7f050007" />
<public type="array" name="bassboost_modes" id="0x7f050008" />
<public type="array" name="bassboost_modes_values" id="0x7f050009" />
<public type="string" name="app_name" id="0x7f060000" />
<public type="string" name="dB" id="0x7f060001" />
<public type="string" name="select_configuration_title" id="0x7f060002" />
<public type="string" name="headset_title" id="0x7f060003" />
<public type="string" name="speaker_title" id="0x7f060004" />
<public type="string" name="bluetooth_title" id="0x7f060005" />
<public type="string" name="dsp_settings_headset" id="0x7f060006" />
<public type="string" name="dsp_settings_speaker" id="0x7f060007" />
<public type="string" name="dsp_settings_bluetooth" id="0x7f060008" />
<public type="string" name="pref_dsp_title" id="0x7f060009" />
<public type="string" name="pref_dsp_summary_on" id="0x7f06000a" />
<public type="string" name="pref_dsp_summary_off" id="0x7f06000b" />
<public type="string" name="pref_dsp_enable" id="0x7f06000c" />
<public type="string" name="pref_effect_title" id="0x7f06000d" />
<public type="string" name="dialog_effect" id="0x7f06000e" />
<public type="string" name="pref_equalizer_title" id="0x7f06000f" />
<public type="string" name="pref_equalizer_summary_on" id="0x7f060010" />
<public type="string" name="pref_equalizer_summary_off" id="0x7f060011" />
<public type="string" name="pref_equalizer_enable" id="0x7f060012" />
<public type="string" name="pref_equalizer_preset_title" id="0x7f060013" />
<public type="string" name="pref_equalizer_loudness_title" id="0x7f060014" />
<public type="string" name="pref_bassboost_title" id="0x7f060015" />
<public type="string" name="pref_bassboost_summary_on" id="0x7f060016" />
<public type="string" name="pref_bassboost_summary_off" id="0x7f060017" />
<public type="string" name="pref_bassboost_enable" id="0x7f060018" />
<public type="string" name="pref_headset_virtual_title" id="0x7f060019" />
<public type="string" name="pref_headset_virtual_summary_on" id="0x7f06001a" />
<public type="string" name="pref_headset_virtual_summary_off" id="0x7f06001b" />
<public type="string" name="pref_headset_virtual_enable" id="0x7f06001c" />
<public type="string" name="pref_room_title" id="0x7f06001d" />
<public type="string" name="dialog_room" id="0x7f06001e" />
<public type="string" name="menu_reset" id="0x7f06001f" />
<public type="string" name="eq_preset_acoustic" id="0x7f060020" />
<public type="string" name="eq_preset_bass_booster" id="0x7f060021" />
<public type="string" name="eq_preset_bass_reducer" id="0x7f060022" />
<public type="string" name="eq_preset_classical" id="0x7f060023" />
<public type="string" name="eq_preset_deep" id="0x7f060024" />
<public type="string" name="eq_preset_flat" id="0x7f060025" />
<public type="string" name="eq_preset_r_and_b" id="0x7f060026" />
<public type="string" name="eq_preset_rock" id="0x7f060027" />
<public type="string" name="eq_preset_small_speakers" id="0x7f060028" />
<public type="string" name="eq_preset_treble_booster" id="0x7f060029" />
<public type="string" name="eq_preset_treble_reducer" id="0x7f06002a" />
<public type="string" name="eq_preset_vocal_booster" id="0x7f06002b" />
<public type="string" name="eq_preset_kuro_max" id="0x7f06002c" /> //this value is added by me to match the eq preset addition on array.xml
<public type="string" name="eq_preset_kuro_bass" id="0x7f06002d" /> //this one too. remember that the address should be different each other
<public type="string" name="eq_preset_custom" id="0x7f06002e" /> //you should change this address too.
<public type="string" name="dsp_settings" id="0x7f06002f" /> //don't forget this one :P the address is on hexadecimal code, so that the next number will be 0x7f060030
<public type="menu" name="menu" id="0x7f070000" />
<public type="id" name="FrequencyResponse" id="0x7f080000" />
<public type="id" name="reset" id="0x7f080001" />
</resources>
for the last part, open your string.xml. we need to register the eq preset here too.
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Beats™ Manager</string> //simply the app name. you can play with it. the rest part of this file is the UI message.
<string name="dB">+0 dB</string>
<string name="select_configuration_title">Menu Configuration</string>
<string name="headset_title">Beats™ Headset</string>
<string name="speaker_title">Beats™ Speaker</string>
<string name="bluetooth_title">Beats™ Bluetooth Device</string>
<string name="dsp_settings_headset">Beats™ Settings - Headset</string>
<string name="dsp_settings_speaker">Beats™ Settings - Speaker</string>
<string name="dsp_settings_bluetooth">Beats™ Settings - Bluetooth Device</string>
<string name="pref_dsp_title">Dynamic Range Compression</string>
<string name="pref_dsp_summary_on">Compression is enabled</string>
<string name="pref_dsp_summary_off">Compression is disabled</string>
<string name="pref_dsp_enable">Enable</string>
<string name="pref_effect_title">Select Effect Strength</string>
<string name="dialog_effect">Effect Strength</string>
<string name="pref_equalizer_title">Beats™ Equalizer</string>
<string name="pref_equalizer_summary_on">Equalizer is enabled</string>
<string name="pref_equalizer_summary_off">Equalizer is disabled</string>
<string name="pref_equalizer_enable">Enable</string>
<string name="pref_equalizer_preset_title">Select Preset</string>
<string name="pref_equalizer_loudness_title">Loudness compensation</string>
<string name="pref_bassboost_title">Beats™ Bass Boost</string>
<string name="pref_bassboost_summary_on">Bass Boost is enabled</string>
<string name="pref_bassboost_summary_off">Bass Boost is disabled</string>
<string name="pref_bassboost_enable">Enable</string>
<string name="pref_headset_virtual_title">Beats™ Virtual Effect</string>
<string name="pref_headset_virtual_summary_on">Virtual Effect is enabled</string>
<string name="pref_headset_virtual_summary_off">Virtual Effect is disabled</string>
<string name="pref_headset_virtual_enable">Enable</string>
<string name="pref_room_title">Select Room Type</string>
<string name="dialog_room">Room Type</string>
<string name="menu_reset">Reset</string>
<string name="eq_preset_acoustic">Acoustic</string>
<string name="eq_preset_bass_booster">Bass Booster</string>
<string name="eq_preset_bass_reducer">Bass Reducer</string>
<string name="eq_preset_classical">Classical</string>
<string name="eq_preset_deep">Deep</string>
<string name="eq_preset_flat">Flat</string>
<string name="eq_preset_r_and_b">R&B</string>
<string name="eq_preset_rock">Rock</string>
<string name="eq_preset_small_speakers">Small Speakers</string>
<string name="eq_preset_treble_booster">Treble Booster</string>
<string name="eq_preset_treble_reducer">Treble Reducer</string>
<string name="eq_preset_vocal_booster">Vocal Booster</string>
<string name="eq_preset_kuro_max">Max Amp</string> //our new eq preset
<string name="eq_preset_kuro_bass">Kuro Bass</string> //this one too :P
<string name="eq_preset_custom">Custom</string>
</resources>
btw, the icon is stored inside /res/drawable-hdpi. you can play with it. this is all I know about this app. please don't ask me how to decompile and recompile it
Hell Yeah Kuro!!! Just great:thumbup:
Sent from my GT-S5360 using xda premium
great brotha :victory:
Compatible with xLoud+Beats+Bravia?
if you're using real xloud, then the answer is no. if you're using the modified one. yes
kurotsugi said:
if you're using real xloud, then the answer is no. if you're using the modified one. yes
Click to expand...
Click to collapse
Just tested it.. its working!
we still have a lot of slot on the eq preset. if you're familiar with this app structure you can modify it by yourself to add more eq and setting.
EDIT: a tut will be nice. however, I didn't want to publish any tut regarding this app modification on public. if anyone interested on how to modify dsp manager you can contact me via PM. apktool/manager/ or anything similar with it is minimum requirement for this modification. a picture editor is also necessary if you want to modify the icon.
kurotsugi said:
we still have a lot of slot on the eq preset. if you're familiar with this app structure you can modify it by yourself to add more eq and setting.
Click to expand...
Click to collapse
Is the dynamic range compression fix? I want to replace dsp manager on CoD Rom sir
Sent from my GT-S5360 using Xparent SkyBlue Tapatalk 2
nope...I didn't touch the smali code
kurotsugi said:
nope...I didn't touch the smali code
Click to expand...
Click to collapse
Yup... Already use it almost broke my eardrum (lol), so I leave it untick
Still it's better ‎​than dsp manager :good:
Sent from my GT-S5360 using Xparent SkyBlue Tapatalk 2
if you want to use dynamic range...you can use it at low setting. it won't give you any those bug. it only work with stock music player.
kurotsugi said:
if you want to use dynamic range...you can use it at low setting. it won't give you any those bug. it only work with stock music player.
Click to expand...
Click to collapse
It just fine to leave it untick coz already try to set it low but the shock rising sound is still occured sir
Sent from my GT-S5360 using Xparent SkyBlue Tapatalk 2
i changed my mind...the tutorial is on 1st post. please don't ask me how to decompile-recompile the app or why your tools can't recompile it.
Awsome sir, you're cool
Sent from my GT-S5360
nice post..
thank u sir.awesome...
post updated. need report from stock music player user
kurotsugi said:
post updated. need report from stock music player user
Click to expand...
Click to collapse
have tested on stock music player.have dynamic....tested in all settings and there was no issue it works perfect.anyway a good work from you,thanx.:good:
Sir..:'(
Fc on my device :crying:
Globally recognised & certified NOOB
alkesh95 said:
Sir..:'(
Fc on my device :crying:
Globally recognised & certified NOOB
Click to expand...
Click to collapse
wich player are u using/did u have previous dsp one deleted?

[Q] How to take a screenshot of vertical and horizontal layout in Android

I have an app which displays a table/matrix of a Math exercise. This table can be really big so I use vertical and horizontal layout. I need to take a screenshot of the whole layout, but it only saves screenshot of visible screen. What should I do?
This is my layout
Code:
<ScrollView xmlns:android="...I cant post link because of spam filter..."
android:id="@+id/myScrollView"
xmlns:tools="..."
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<HorizontalScrollView
android:id="@+id/myHorizontalScrollView"
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<TableLayout
android:id="@+id/myTableLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="1" />
</HorizontalScrollView>
</ScrollView>
This is how I take screenshot but only visible screen, not whole layout
Code:
View v1 = getWindow().getDecorView().getRootView();
v1.setDrawingCacheEnabled(true);
Bitmap myBitmap = v1.getDrawingCache();
saveBitmap(myBitmap); // saves to storage
Edit: With this code, I can take screenshot of very wide table but if it is also too high, app crashes and it says: View too large to fit into drawing cache, needs 2030336 bytes, only 1536000 available . Now I dont know if the problem is method I am using to capture the view or it is simply not possible to capture table with for example 20 rows and columns. Why is the bitmap so big?
Code:
TableLayout tableView = (TableLayout) findViewById(R.id.myTableLayout);
tableView.setDrawingCacheEnabled(true);
tableView.layout(0, 0, tableView.getWidth(), tableView.getHeight());
tableView.buildDrawingCache(true);
tableView.setBackgroundColor(Color.WHITE);
Bitmap bitmap = Bitmap.createBitmap(tableView.getDrawingCache());
tableView.setDrawingCacheEnabled(false);

Color Your Photos with Stickers-Huawei Image Kit

HUAWEI Image Kit incorporates smart image editing and design as well as animation capabilities into your app, giving it the power of efficient image content reproduction while providing a better image editing experience for your users.
Use Cases
Image postprocessing
Provides more than 20 distinct effects for image processing, achieving high-quality image content reproduction.
Implements smart layout of images and texts for efficient content production.
Provides the sticker and text art function for image DIY.
Implements theme tagging for images and objects in images for convenient retrieval.
Implements image cropping for users to resize images.
Theme design
Applies animations to lock screens, wallpapers, and themes.
Image Kit does not provide sticker and text art resources. You need to design and generate stickers and text arts in compliance with the specifications provided by Huawei. But Huawei supply sample stickers. You can find how to develop stickers and sample stickers in this link.
Click to expand...
Click to collapse
Today I will show you how to add, delete and save stickers to photos. Let’s start. First of all, please follow these steps to create an app on App Gallery.
When using Image Kit on a mobile phone where the HMS Core (APK) is installed, add the SDK dependency. When using Image Kit on a device where the HMS Core (APK) is not installed, add the fallback-SDK dependency. The service dependency configuration is as follows. Image Vision service:
SDK: com.huawei.hms:image-vision:1.0.3.301
fallback-SDK: com.huawei.hms:image-vision:1.0.3.301 , com.huawei.hms:image-vision-fallback:1.0.3.301
Code:
implementation 'com.huawei.hms:image-vision:1.0.3.301'
The implementation of all APIs of the sticker service is based on StickerLayout, which is a custom view. The imported service package is com.huawei.hms.image.vision.sticker.StickerLayout, which can be directly integrated into the XML of the layout. Now, let’s create a layout file.
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
tools:context=".fragments.StickerDetailFragment">
<RelativeLayout
android:id="@+id/sticker_img_layout"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.55"
android:background="@color/white"
android:gravity="center"
android:paddingLeft="30dp"
android:paddingTop="30dp"
android:paddingRight="30dp">
<ImageView
android:id="@+id/imgPhotosticker"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/template" />
<com.huawei.hms.image.vision.sticker.StickerLayout
android:id="@+id/sticker_container"
android:layout_width="wrap_content"
android:layout_height="295dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.20"
android:gravity="center"
android:paddingLeft="30dp"
android:paddingTop="30dp"
android:paddingRight="30dp">
<Button
android:id="@+id/btn_removeSticks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/fonts"
android:layout_alignParentBottom="true"
android:text="Delete All" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.25">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvListSticker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F8F8F8"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintVertical_bias="1.0" />
</RelativeLayout>
</LinearLayout>
Download the sample stickers from this link and add your project as a assets .You can change some features in theme.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
-<HwTheme>
<item style="sticker"/>
<stickerposition>Default</stickerposition>
<stickerscreen>w="360" h="360"</stickerscreen>
</HwTheme>
More information . you can check https://forums.developer.huawei.com/forumPortal/en/topic/0203430496621480052
Well explained can we add emojis while editing images?
Nice. ty mate
sujith.e said:
Well explained can we add emojis while editing images?
Click to expand...
Click to collapse
Hi, you can make a reply below this link https://forums.developer.huawei.com/forumPortal/en/topic/0203430496621480052?fid=0101187876626530001
Here you can acquire more professional answer
Does Sticker Layout working as an overlay on the image or it making some changes in Image Pixels?
Interesting hope to hands on Huawei phone asap
Is perfect
Very nice features.

Categories

Resources