[Guide] Alternative View Pager
[Guide] Alternative View Pager - Hallo sobat Jogja Android Blog, Pada Artikel yang sobat baca kali ini dengan judul [Guide] Alternative View Pager, kami telah mempersiapkan artikel ini dengan baik untuk sobat baca dan ambil informasi didalamnya. Mudah-mudahan isi postingan [Guide] Alternative View Pager yang kami tulis ini dapat sobat Jogja Android Blog pahami. Baiklah, selamat membaca sambil menikmati kopi.
Alternative View Pager STEP 1
Bahan - bahan :
1. Phone StatusBar,smali [Download]
2. Status_bar_expanded_mod.xml [Download]
3. Status_bar_expanded_ori.xml [Download]
4. SysteUI apk.zip [Download]
Langkah - langkah :
1.Taruh smali nya,,compare expanded nya,,,tambahkan di values yg udah di siapin
2. Recompile
3. Mulai edit PhoneStatusBar.smali ente
4. Search Customdrawer di phoneStatusBar.smali ane
5. Untuk id nya cuma ada 2
<public type="id" name="custom_drawer_layout" id="0x7f08014c" />
<public type="color" name="custom_drawer_layout_scrin" id="0x7f090006" />
6. Kalo udah bisa next view pager tanpa mNotificationsLayout
Alternative View Pager STEP 2
Bahan- bahan :
1. gemini_status_bar_expanded.xml [Download]
2. NotificationRowLayout.smali [Download]
3. PhoneStatusBar.smali [Download]
4. res.zip [Download]
5. Smali.zip [Download]
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ExpandedPagerAdapter;
---------------------
}
.end annotation
search (.field private mP) paste di bawah nya
---------
.field private mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;######################################
.field private mExpandedViewPagerTabStrip:Landroid/support/v4/view/PagerTabStrip;
.field private mPowerTogglesLayout:Landroid/view/View;
.field private mNotificationsLayout:Landroid/view/View;
.field private mSlidersLayout:Landroid/view/View;
search $700 paste di atas nya
----------------
.method static synthetic access$6200(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;######################################
.locals 1
.parameter
.prologue
.line 21
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationsLayout:Landroid/view/View;
return-object v0
.end method
.method static synthetic access$6300(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
.locals 1
.parameter
.prologue
.line 22
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerTogglesLayout:Landroid/view/View;
return-object v0
.end method
.method static synthetic access$6400(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/content/Context;
.locals 1
.parameter
.prologue
.line 18
iget-object v0, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
return-object v0
.end method
.method static synthetic access$6500(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
.locals 1
.parameter
.prologue
.line 22
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSlidersLayout:Landroid/view/View;
return-object v0
.end method
.method static synthetic access$6800(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Lcom/serajr/viewpager/CustomViewPager;
.locals 1
.parameter
.prologue
.line 32
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
return-object v0
.end method
.method static synthetic access$6900(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
.locals 1
.parameter
.prologue
.line 22
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedContents:Landroid/view/View;
return-object v0
.end method
seach kode (.method private s) paste di atas nya
-------------
.method private setExpandedViewPagerBlockPagingView()V
.locals 2
.prologue
.line 55
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedContents:Landroid/view/View;
invoke-virtual {v0, v1}, Lcom/serajr/viewpager/CustomViewPager;->setBlockPagingView(Landroid/view/View;)V
.line 86
return-void
.end method
.method private setupStatusBarExpandedViewPager()V
.locals 7
.prologue
const/4 v5, 0x0
const/4 v4, 0x0
.line 44
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
const-string v3, "layout_inflater"
invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/view/LayoutInflater;
.local v1, inflater:Landroid/view/LayoutInflater;
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const v3, 0x7f040052
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getLayout(I)Landroid/content/res/XmlResourceParser;
move-result-object v2
invoke-virtual {v1, v2, v4}, Landroid/view/LayoutInflater;->inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;)Landroid/view/View;
move-result-object v2
iput-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationsLayout:Landroid/view/View;
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const v3, 0x7f040053
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getLayout(I)Landroid/content/res/XmlResourceParser;
move-result-object v2
invoke-virtual {v1, v2, v4}, Landroid/view/LayoutInflater;->inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;)Landroid/view/View;
move-result-object v2
iput-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerTogglesLayout:Landroid/view/View;
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const v3, 0x7f040054
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getLayout(I)Landroid/content/res/XmlResourceParser;
move-result-object v2
invoke-virtual {v1, v2, v4}, Landroid/view/LayoutInflater;->inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;)Landroid/view/View;
move-result-object v2
iput-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSlidersLayout:Landroid/view/View;
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ExpandedPagerAdapter;
invoke-direct {v0, p0, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ExpandedPagerAdapter;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ExpandedPagerAdapter;)V
.local v0, expandedPagerAdapter:Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ExpandedPagerAdapter;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;
const v3, 0x7f08014d
invoke-virtual {v2, v3}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->findViewById(I)Landroid/view/View;
move-result-object v2
check-cast v2, Lcom/serajr/viewpager/CustomViewPager;
iput-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
new-instance v3, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$46;
invoke-direct {v3, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$46;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v2, v5, v3}, Lcom/serajr/viewpager/CustomViewPager;->setPageTransformer(ZLandroid/support/v4/view/ViewPager$PageTransformer;)V
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
invoke-virtual {v2, v0}, Lcom/serajr/viewpager/CustomViewPager;->setAdapter(Landroid/support/v4/view/PagerAdapter;)V
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
const/4 v3, 0x0
invoke-virtual {v2, v3}, Lcom/serajr/viewpager/CustomViewPager;->setCurrentItem(I)V
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
new-instance v3, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$45;
invoke-direct {v3, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$45;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v2, v3}, Lcom/serajr/viewpager/CustomViewPager;->setOnPageChangeListener(Landroid/support/v4/view/ViewPager$OnPageChangeListener;)V
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;
const v3, 0x7f08014e
invoke-virtual {v2, v3}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->findViewById(I)Landroid/view/View;
move-result-object v2
check-cast v2, Landroid/support/v4/view/PagerTabStrip;
iput-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPagerTabStrip:Landroid/support/v4/view/PagerTabStrip;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPagerTabStrip:Landroid/support/v4/view/PagerTabStrip;
const/4 v3, 0x1
invoke-virtual {v2, v3}, Landroid/support/v4/view/PagerTabStrip;->setDrawFullUnderline(Z)V
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPagerTabStrip:Landroid/support/v4/view/PagerTabStrip;
iget-object v3, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x7f090009
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
invoke-virtual {v2, v3}, Landroid/support/v4/view/PagerTabStrip;->setTabIndicatorColor(I)V
return-void
.end method
++++++++++++++++++++++++++++++++++++++++
KHUSUS JB 4.1 ubah di atas seperti ini
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Landroid/view/View;------------------
const v3, 0x7f08014d
invoke-virtual {v2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Landroid/view/View;
const v3, 0x7f08014e
invoke-virtual {v2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;
############################################################################
const v2, 0x7f080058 <public type="id" name="notification_panel" id="0x7f080058" /> bawaan expanded line 2
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Lcom/android/systemui/statusbar/phone/NotificationPanelView;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;
kode
.line 43
-----------------di pake
move-object/from16 v0, p0------------------
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupStatusBarExpandedViewPager()V
JB 4.1
kode
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Landroid/view/View;
.line 43
-----------------di pake
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupStatusBarExpandedViewPager()V
kode
.method makeExpandedVisible(Z)V------------di pake
.line 1591
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mWindowManager:Landroid/view/WindowManager;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
invoke-interface {v1, v2, v0}, Landroid/view/WindowManager;->updateViewLayout(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;-----------
const/4 v2, 0x0
invoke-virtual {v0, v2}, Lcom/serajr/viewpager/CustomViewPager;->setCurrentItem(I)V
-----------di pake
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setExpandedViewPagerBlockPagingView()V
atau
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setExpandedViewPagerBlockPagingView()V
Search (viewpager) di NotificationRowLayout.smali
ExpandedPagerAdapter.smali---->
0x7f0b00ee string tab_1
0x7f0b00ef string tab_2
0x7f0b00f0 string tab_3
Alternative View Pager STEP 3
Bahan - bahan :
1. AndroidManifest.xml [Download]
2. PhoneStatusBar.smali [Download]
3. res.zip [Download]
4. smali.zip [Download]
Langkah - langkah :
1. Search (powertoggleslayout) taruh di bawah nya
.field private mPowerToggles:Lcom/serajr/powertoggles/PowerToggles-------------------------------------------------
kode
.method private setupStatusBarExpandedViewPager()V
------Start taruh di atas method di atas ini
.method private setupPowerToggles()V------------------stop
.locals 2
.prologue
.line 107
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerTogglesLayout:Landroid/view/View;
const v1, 0x7f08014f--->id power_toggles
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/serajr/powertoggles/PowerToggles;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
const/4 v1, 0x3
invoke-virtual {v0, v1}, Lcom/serajr/powertoggles/PowerToggles;->buttonMeProfileCellSpan(I)V
.line 108
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
invoke-virtual {v0}, Lcom/serajr/powertoggles/PowerToggles;->setupPowerToggles()V
.line 109
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
invoke-virtual {v0}, Lcom/serajr/powertoggles/PowerToggles;->updatePowerToggles()V
.line 111
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$49;
invoke-direct {v1, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$49;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v0, v1}, Lcom/serajr/powertoggles/PowerToggles;->setChangeContentObserverListener(Lcom/serajr/powertoggles/PowerToggles$ChangeObserverCallbackInterface;)V
.line 115
return-void
.end method
.method public powerTogglesEnabledCallback()V
.locals 3
.prologue
const/4 v2, 0x1
.line 146
iget-object v0, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "power_toggles_enabled"
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-ne v0, v2, :cond_0
.line 149
const-string v0, "powerTogglesEnabledCallback"
const-string v1, "enabled"
invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 151
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->enableExpandedViewPager()V
.line 153
:goto_0
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadDimens()V
.line 154
return-void
.line 155
:cond_0
const-string v0, "powerTogglesEnabledCallback"
const-string v1, "disabled"
invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 157
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->disableExpandedViewPager()V
goto :goto_0
.end method
.method private disableExpandedViewPager()V
.locals 2
.prologue
const/4 v1, 0x0
.line 96
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z
if-eqz v0, :cond_0
.line 99
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->animateCollapsePanels()V
.line 104
:cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
invoke-virtual {v0, v1}, Lcom/serajr/viewpager/CustomViewPager;->setCurrentItem(I)V
.line 107
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
invoke-virtual {v0, v1}, Lcom/serajr/viewpager/CustomViewPager;->setPagingEnabled(Z)V
.line 110
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPagerTabStrip:Landroid/support/v4/view/PagerTabStrip;
const/16 v1, 0x8
invoke-virtual {v0, v1}, Landroid/support/v4/view/PagerTabStrip;->setVisibility(I)V
.line 112
return-void
.end method
.method private enableExpandedViewPager()V
.locals 3
.prologue
const/4 v2, 0x0
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z
if-eqz v0, :cond_0
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->animateCollapsePanels()V
:cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
invoke-virtual {v0, v2}, Lcom/serajr/viewpager/CustomViewPager;->setCurrentItem(I)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPager:Lcom/serajr/viewpager/CustomViewPager;
const/4 v1, 0x1
invoke-virtual {v0, v1}, Lcom/serajr/viewpager/CustomViewPager;->setPagingEnabled(Z)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedViewPagerTabStrip:Landroid/support/v4/view/PagerTabStrip;
invoke-virtual {v0, v2}, Landroid/support/v4/view/PagerTabStrip;->setVisibility(I)V
return-void
.end method
kode
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupCustomDrawerLayout()V
-------------------star di bawah ini taruh di bawah nya setup di atas----------
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerToggles()V
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->powerTogglesEnabledCallback()V
atau
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerToggles()V
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->powerTogglesEnabledCallback()V
2. Repalace fiqih_status_bar_expanded_powertoggles.xml
SS
Credit to :
Syaiful Opreker
Group M.A.A.A.D.R
Demikian Artikel dengan judul [Guide] Alternative View Pager
Mudah-mudahan bisa memberi manfaat untuk sobat Jogja Android Blog semua. Baiklah, sampai jumpa di postingan artikel lainnya.
Sobat Jogja Android Blog sekarang membaca artikel [Guide] Alternative View Pager dengan alamat link https://jogjandroidz.blogspot.com/2014/11/guide-alternative-view-pager.html
0 Response to "[Guide] Alternative View Pager"
Post a Comment