您當前位置>首頁 » 新聞資訊 » 技(jì)術(shù)分(fēn)享 >
定制(zhì)自(zì)動開(kāi)關機(jī)設置界面
發表時(shí)間(jiān):2021-1-4
發布人(rén):葵宇科(kē)技(jì)
浏覽次數(shù):90
差分(fēn)包:
--- a/idh.code/packages/apps/Settin∑←δ∑gs/res/layout/alarm_time.xml
+++ b/↓©™idh.code/packages/apps/Settings/r✘§×es/layout/alarm_time.xml
@@ -2,19¥ +2,35 @@
<!-- Create by Spr¶∑$eadst -->
<LinearLayout
xmlns:and≈λroid="http://schemas.android.co↔←m/apk/res/android"
+ android:paddi♠ <ngLeft="5dip"
android:layout_wi→¶dth="match_parent"
≥≠ android:layout_height="wrap_co$✔δδntent"
android:orientation="hδ←&orizontal">
-
- <TextView android✔→ :id="@+id/poweronoff"
+
+ <βδ ImageView android:id="@+id/power_on_off&q™™≠uot;
android:layout_width="wrap_c÷<≤λontent"
- android:layoα≠∑ut_height="wrap_content"
- σ↕★α android:layout_weight="1"
- ™₩×♦ android:textColor="?android:attr/textCol∏πorPrimary"
- android:paddingTop♣πδ="20dip"
- android:padd✔€ingLeft="10dip"
- ≠≈∞ android:paddingRight="10dip"
- §↑ android:textAppearance="?andro✘"$id:attr/textAppearanceMedium& &©quot;/>
+ android:layout_h≈δ♠♦eight="match_parent"/>
+ γ↕
+ <LinearLayout
+ a↑♣£←ndroid:layout_width="wr₽∏₩ap_content"
+ an€φ>★droid:layout_height="wrap_content&quoπ t;
+ android:orientation=&qu•₽↓ot;vertical"
+ android:paddin≥≈☆★gTop="10dip"
+ π∏★android:paddingLeft="10dip"
+ α<©λ android:paddingRight="10dip&•σ¶☆quot;
+ android:layout_weight="♠&1">
+ <TextView android ÷:id="@+id/time"
+ π☆☆ android:layout_width="wraφ₩≤p_content"
+ ♥♦ android:layout_height=&quo™δ ≠t;wrap_content"
+ ↑★↑± android:textColor="?android:at≤&≥£tr/textColorPrimary"
+ ♥★γ android:textSizeε ¥₽="24dip"
+ ε®♣ android:textAppearance="?android:a$≤ttr/textAppearanceMedium&q€✘•₩uot;/>
+ <Tex↔∏$tView android:id="@+id/dayweek✘α∏&"
+ androi♣✘d:layout_width="wrap_content&qu✔₽ot;
+ android:layout_heightΩ€="wrap_content"
£α+ an×"©droid:textSize="14dip"
+ ✔₹® android:textColor="?an<↓droid:attr/textColorPrimary"/>
+ ≤♠ </LinearLayout>
¥↑ <!-- Modify at 2013-02-01 , for ×÷•§fix bug 123733 start -->
↑$<!-- android:background="@drawable/clock_♥∞≥selector" -->
<!-- Modify at α©≈$2013-02-01 , for fix bug 123733 end -->₩¥≠π;
diff --git a/idh.code/packages/apps/Setting® s/src/com/sprd/settings/timerpowerγβ→/AlarmClock.java b/idh.code/packages/app × s/Settings/src/com
old mode 100644
ne'¥w mode 100755
index 9c4ddf5..7d16157
--- aπ♥/idh.code/packages/apps/Se₩™ttings/src/com/sprd/settings/tim←'erpower/AlarmClock.java
+++ b/idh.code/package↑¥≥s/apps/Settings/src/com/sprd/se$∏σ≥ttings/timerpower/AlarmClock.java
@@ -23,7 +23,6 ≤ @@ import android.widget.AdapterView.OnIφ€temClickListener;
import com.android.sett↓ings.R;
import com.android.settings.Settings;
-
'↕φ® /**
* Power ON/OFF applicatio↑&≥n.
*/
@@ -61,7 +60,7 @@ public class Alaπ✔♠rmClock extends Activity imp>©₩lements OnItemClickListener {
β public void bindView(View view, Contexφ×δt context, Cursor cursor) {
fina•₹l Alarm alarm = new Alarm(AlarmClock.this×≥✔,cursor);
-
+ SetAl£★arm sAlarm = new SetAlarm();
View ≠♦φ₩indicator = view.findViewById(R.id.indicator);
₽&
// Set the initial stateβε£÷ of the clock "checkbox"
@@ -78,15 +77₽&✔,19 @@ public class AlarmClock≥¶• extends Activity implements OnIte∑≠φmClickListener {
}
£§ });
Log.v("timerpower★ε±∞ AlarmClock -------------------- >&g>→≠t;>>>>>>>>>>>&©'☆αgt;> "+alarm.label);
- final<γ TextView powerOnOff = (TextView)view.findViewByI↔>₩↓d(R.id.poweronoff);
+
+ fiεΩnal ImageView iPowerOnOff = (Image₽β"View)view.findViewById(R.id.power_on_off);
×€δ÷+ final TextView tTime = (TextView)vi→₩≈ew.findViewById(R.id.time);
+ ✘↔ final TextView tDayWeek = (TextVi↔ε'ew)view.findViewById(R.id.da¶✘÷yweek);
if(!alarm.label.equals(&q→∞™↔uot;") && alarm.label♦★★α.equals("on"))
{
- >§₽₽ powerOnOff.setText₹>(R.string.power_on);
+ iPowerOnOf< f.setImageDrawable(context.getResources().ge♥←∏tDrawable(R.drawable.ic_settings_pwr←"on));
}else
≈β¶↕ {
- ε↑±Ω powerOnOff.setText(R.string.power_off);
+ α♥§δ iPowerOnOff.s♣±≥★etImageDrawable(context.getResources().getDrawab✘₹€le(R.drawable.ic_settings_pwroff));
↕ }
-
+ tTime.setText(Alarms.forα☆matTime(context, alarm.hour, ala↕★★±rm.minutes,alarm.daysOfWeek));
+ ✘ >★ tDayWeek.setText(alarm.daysOfWee↔ k.toString(context, false));
}
↑• };
修改後如(rú)圖:
[img]http://img.blog.csdn.net/20150107100217ε↓§₹995?watermark/2/text/aHR0cDovL2Jsb2cuY3NkbiγΩ♦5uZXQvc2lsZW5jZV9jZHNu/fontλ₹★"/5a6L5L2T/fontsize/400/fil™<l/I0JBQkFCMA==/dissolve/70/gr÷β÷∏avity/Center








