How to Center Clock without Gravity Box or Xblast

Requirements 

  • SystemUI
  • Apktool

Screenshot:



Guide:
  1. Decompile your SystemUI
    apktool d SystemUI
  2. go to SystemUI/res/layouts/gemini_status_bar.xml
  3. Find the line that starts with this then cut:
    <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
    or
    <com.android.systemui.statusbar.policy.Clock then 
    cut the whole line but only between brackets
  4. Next go to the top of your gemini_status_bar.xml and place your cursor at the end of this line:xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
  5. Press Enter to create an empty line
  6. Place cursor at the beginning of that empty space and paste this line:
  7. <LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"><com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" /> </LinearLayout>
  8.  or 
    <LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">then paste here your clock code then
    </LinearLayout>
  9. Save the file
  10. Build your SystemUI
    apktool b SystemUI
  11. Sign-in your apk (go to SystemUI/original) copy 2 files then paste it in SystemUI/dist/SystemUI.apk (change it .zip to paste the two file from original folder)
  12. thats it :)

Comments

Popular posts from this blog

OPlus Service Center and Drop Off Center