Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apk
Commits
2c61da00
Commit
2c61da00
authored
Jun 04, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed app startup on Android 2.x, crash fixes
parent
c1896e97
Changes
25
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
215 additions
and
57 deletions
+215
-57
build.gradle
TMessagesProj/build.gradle
+1
-1
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+3
-0
ChatProfileActivity.java
...oj/src/main/java/org/telegram/ui/ChatProfileActivity.java
+1
-0
ChatProfileChangeNameActivity.java
...n/java/org/telegram/ui/ChatProfileChangeNameActivity.java
+1
-0
ContactAddActivity.java
...roj/src/main/java/org/telegram/ui/ContactAddActivity.java
+1
-0
ContactsActivity.java
...sProj/src/main/java/org/telegram/ui/ContactsActivity.java
+1
-5
CountrySelectActivity.java
.../src/main/java/org/telegram/ui/CountrySelectActivity.java
+1
-5
DocumentSelectActivity.java
...src/main/java/org/telegram/ui/DocumentSelectActivity.java
+1
-0
IdenticonActivity.java
...Proj/src/main/java/org/telegram/ui/IdenticonActivity.java
+1
-0
LanguageSelectActivity.java
...src/main/java/org/telegram/ui/LanguageSelectActivity.java
+1
-5
LaunchActivity.java
...gesProj/src/main/java/org/telegram/ui/LaunchActivity.java
+7
-16
MediaActivity.java
...agesProj/src/main/java/org/telegram/ui/MediaActivity.java
+1
-0
MessagesActivity.java
...sProj/src/main/java/org/telegram/ui/MessagesActivity.java
+1
-5
SettingsActivity.java
...sProj/src/main/java/org/telegram/ui/SettingsActivity.java
+1
-0
SettingsBlockedUsers.java
...j/src/main/java/org/telegram/ui/SettingsBlockedUsers.java
+1
-0
SettingsChangeNameActivity.java
...main/java/org/telegram/ui/SettingsChangeNameActivity.java
+1
-0
SettingsWallpapersActivity.java
...main/java/org/telegram/ui/SettingsWallpapersActivity.java
+1
-0
UserProfileActivity.java
...oj/src/main/java/org/telegram/ui/UserProfileActivity.java
+1
-0
ActionBarActivity.java
...va/org/telegram/ui/Views/ActionBar/ActionBarActivity.java
+10
-8
ActionBarLayer.java
.../java/org/telegram/ui/Views/ActionBar/ActionBarLayer.java
+6
-0
ActionBarMenu.java
...n/java/org/telegram/ui/Views/ActionBar/ActionBarMenu.java
+1
-1
ActionBarMenuItem.java
...va/org/telegram/ui/Views/ActionBar/ActionBarMenuItem.java
+5
-6
ActionBarPopupWindow.java
...org/telegram/ui/Views/ActionBar/ActionBarPopupWindow.java
+158
-0
BaseFragment.java
...in/java/org/telegram/ui/Views/ActionBar/BaseFragment.java
+8
-5
styles.xml
TMessagesProj/src/main/res/values/styles.xml
+1
-0
No files found.
TMessagesProj/build.gradle
View file @
2c61da00
...
...
@@ -82,7 +82,7 @@ android {
defaultConfig
{
minSdkVersion
8
targetSdkVersion
19
versionCode
23
4
versionCode
23
6
versionName
"1.4.15"
}
}
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
2c61da00
...
...
@@ -2655,6 +2655,8 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
@Override
public
void
onResume
()
{
super
.
onResume
();
showActionBar
();
checkActionBarMenu
();
...
...
@@ -2741,6 +2743,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
@Override
public
void
onPause
()
{
super
.
onPause
();
actionBarLayer
.
hideActionMode
();
hideEmojiPopup
();
paused
=
true
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java
View file @
2c61da00
...
...
@@ -371,6 +371,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
listViewAdapter
!=
null
)
{
listViewAdapter
.
notifyDataSetChanged
();
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatProfileChangeNameActivity.java
View file @
2c61da00
...
...
@@ -103,6 +103,7 @@ public class ChatProfileChangeNameActivity extends BaseFragment {
@Override
public
void
onResume
()
{
super
.
onResume
();
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"mainconfig"
,
Activity
.
MODE_PRIVATE
);
boolean
animations
=
preferences
.
getBoolean
(
"view_animations"
,
true
);
if
(!
animations
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/ContactAddActivity.java
View file @
2c61da00
...
...
@@ -177,6 +177,7 @@ public class ContactAddActivity extends BaseFragment implements NotificationCent
@Override
public
void
onResume
()
{
super
.
onResume
();
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"mainconfig"
,
Activity
.
MODE_PRIVATE
);
boolean
animations
=
preferences
.
getBoolean
(
"view_animations"
,
true
);
if
(!
animations
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java
View file @
2c61da00
...
...
@@ -358,16 +358,12 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
listViewAdapter
!=
null
)
{
listViewAdapter
.
notifyDataSetChanged
();
}
}
@Override
public
void
onPause
()
{
actionBarLayer
.
closeSearchField
();
}
@Override
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
if
(
id
==
MessagesController
.
contactsDidLoaded
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java
View file @
2c61da00
...
...
@@ -245,16 +245,12 @@ public class CountrySelectActivity extends BaseFragment {
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
listViewAdapter
!=
null
)
{
listViewAdapter
.
notifyDataSetChanged
();
}
}
@Override
public
void
onPause
()
{
actionBarLayer
.
closeSearchField
();
}
public
void
search
(
final
String
query
)
{
if
(
query
==
null
)
{
searchResult
=
null
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java
View file @
2c61da00
...
...
@@ -194,6 +194,7 @@ public class DocumentSelectActivity extends BaseFragment {
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
listAdapter
!=
null
)
{
listAdapter
.
notifyDataSetChanged
();
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java
View file @
2c61da00
...
...
@@ -84,6 +84,7 @@ public class IdenticonActivity extends BaseFragment {
@Override
public
void
onResume
()
{
super
.
onResume
();
fixLayout
();
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java
View file @
2c61da00
...
...
@@ -197,16 +197,12 @@ public class LanguageSelectActivity extends BaseFragment {
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
listAdapter
!=
null
)
{
listAdapter
.
notifyDataSetChanged
();
}
}
@Override
public
void
onPause
()
{
actionBarLayer
.
closeSearchField
();
}
public
void
search
(
final
String
query
)
{
if
(
query
==
null
)
{
searchResult
=
null
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
View file @
2c61da00
...
...
@@ -120,13 +120,9 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
if
(
fragmentsStack
.
isEmpty
())
{
if
(!
UserConfig
.
clientActivated
)
{
LoginActivity
fragment
=
new
LoginActivity
();
fragment
.
onFragmentCreate
();
fragmentsStack
.
add
(
fragment
);
addFragmentToStack
(
new
LoginActivity
());
}
else
{
MessagesActivity
fragment
=
new
MessagesActivity
(
null
);
fragment
.
onFragmentCreate
();
fragmentsStack
.
add
(
fragment
);
addFragmentToStack
(
new
MessagesActivity
(
null
));
}
try
{
...
...
@@ -137,37 +133,32 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
if
(
fragmentName
.
equals
(
"chat"
))
{
if
(
args
!=
null
)
{
ChatActivity
chat
=
new
ChatActivity
(
args
);
if
(
chat
.
onFragmentCreate
())
{
fragmentsStack
.
add
(
chat
);
if
(
addFragmentToStack
(
chat
))
{
chat
.
restoreSelfArgs
(
savedInstanceState
);
}
}
}
else
if
(
fragmentName
.
equals
(
"settings"
))
{
SettingsActivity
settings
=
new
SettingsActivity
();
settings
.
onFragmentCreate
(
);
addFragmentToStack
(
settings
);
settings
.
restoreSelfArgs
(
savedInstanceState
);
fragmentsStack
.
add
(
settings
);
}
else
if
(
fragmentName
.
equals
(
"group"
))
{
if
(
args
!=
null
)
{
GroupCreateFinalActivity
group
=
new
GroupCreateFinalActivity
(
args
);
if
(
group
.
onFragmentCreate
(
))
{
if
(
addFragmentToStack
(
group
))
{
group
.
restoreSelfArgs
(
savedInstanceState
);
fragmentsStack
.
add
(
group
);
}
}
}
else
if
(
fragmentName
.
equals
(
"chat_profile"
))
{
if
(
args
!=
null
)
{
ChatProfileActivity
profile
=
new
ChatProfileActivity
(
args
);
if
(
profile
.
onFragmentCreate
(
))
{
if
(
addFragmentToStack
(
profile
))
{
profile
.
restoreSelfArgs
(
savedInstanceState
);
fragmentsStack
.
add
(
profile
);
}
}
}
else
if
(
fragmentName
.
equals
(
"wallpapers"
))
{
SettingsWallpapersActivity
settings
=
new
SettingsWallpapersActivity
();
settings
.
onFragmentCreate
(
);
addFragmentToStack
(
settings
);
settings
.
restoreSelfArgs
(
savedInstanceState
);
fragmentsStack
.
add
(
settings
);
}
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java
View file @
2c61da00
...
...
@@ -253,6 +253,7 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
listAdapter
!=
null
)
{
listAdapter
.
notifyDataSetChanged
();
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java
View file @
2c61da00
...
...
@@ -378,17 +378,13 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
@Override
public
void
onResume
()
{
super
.
onResume
();
showActionBar
();
if
(
messagesListViewAdapter
!=
null
)
{
messagesListViewAdapter
.
notifyDataSetChanged
();
}
}
@Override
public
void
onPause
()
{
actionBarLayer
.
closeSearchField
();
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java
View file @
2c61da00
...
...
@@ -546,6 +546,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
@Override
public
void
onResume
()
{
super
.
onResume
();
showActionBar
();
if
(
listAdapter
!=
null
)
{
listAdapter
.
notifyDataSetChanged
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java
View file @
2c61da00
...
...
@@ -252,6 +252,7 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
listViewAdapter
!=
null
)
{
listViewAdapter
.
notifyDataSetChanged
();
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java
View file @
2c61da00
...
...
@@ -115,6 +115,7 @@ public class SettingsChangeNameActivity extends BaseFragment {
@Override
public
void
onResume
()
{
super
.
onResume
();
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"mainconfig"
,
Activity
.
MODE_PRIVATE
);
boolean
animations
=
preferences
.
getBoolean
(
"view_animations"
,
true
);
if
(!
animations
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java
View file @
2c61da00
...
...
@@ -424,6 +424,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
listAdapter
!=
null
)
{
listAdapter
.
notifyDataSetChanged
();
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java
View file @
2c61da00
...
...
@@ -436,6 +436,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
listAdapter
!=
null
)
{
listAdapter
.
notifyDataSetChanged
();
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarActivity.java
View file @
2c61da00
...
...
@@ -33,10 +33,6 @@ import android.widget.FrameLayout;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.R
;
import
org.telegram.messenger.Utilities
;
import
org.telegram.ui.ChatActivity
;
import
org.telegram.ui.GroupCreateFinalActivity
;
import
org.telegram.ui.SettingsActivity
;
import
org.telegram.ui.SettingsWallpapersActivity
;
import
java.util.ArrayList
;
...
...
@@ -315,7 +311,7 @@ public class ActionBarActivity extends Activity {
@Override
public
void
onBackPressed
()
{
if
(
startedTracking
||
checkTransitionAnimation
())
{
if
(
startedTracking
||
checkTransitionAnimation
()
||
fragmentsStack
.
isEmpty
()
)
{
return
;
}
if
(
actionBar
.
currentLayer
!=
null
&&
actionBar
.
currentLayer
.
isSearchFieldVisible
)
{
...
...
@@ -488,6 +484,15 @@ public class ActionBarActivity extends Activity {
return
true
;
}
public
boolean
addFragmentToStack
(
BaseFragment
fragment
)
{
if
(!
fragment
.
onFragmentCreate
())
{
return
false
;
}
fragment
.
setParentActivity
(
this
);
fragmentsStack
.
add
(
fragment
);
return
true
;
}
private
void
closeLastFragmentInternalRemoveOld
(
BaseFragment
fragment
)
{
fragment
.
onPause
();
fragment
.
onFragmentDestroy
();
...
...
@@ -566,9 +571,6 @@ public class ActionBarActivity extends Activity {
}
public
void
removeFragmentFromStack
(
BaseFragment
fragment
)
{
// if (!fragmentsStack.isEmpty() && fragmentsStack.get(fragmentsStack.size() - 1) == fragment) {
// return;
// }
fragment
.
onFragmentDestroy
();
fragment
.
setParentActivity
(
null
);
fragmentsStack
.
remove
(
fragment
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarLayer.java
View file @
2c61da00
...
...
@@ -437,4 +437,10 @@ public class ActionBarLayer extends FrameLayout {
menu
.
onMenuButtonPressed
();
}
}
protected
void
onPause
()
{
if
(
menu
!=
null
)
{
menu
.
hideAllPopupMenus
();
}
}
}
\ No newline at end of file
TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenu.java
View file @
2c61da00
...
...
@@ -87,7 +87,7 @@ public class ActionBarMenu extends LinearLayout {
return
menuItem
;
}
public
void
onDestroy
()
{
public
void
hideAllPopupMenus
()
{
for
(
int
a
=
0
;
a
<
getChildCount
();
a
++)
{
View
view
=
getChildAt
(
a
);
if
(
view
instanceof
ActionBarMenuItem
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenuItem.java
View file @
2c61da00
...
...
@@ -23,7 +23,6 @@ import android.widget.EditText;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.PopupWindow
;
import
android.widget.TextView
;
import
org.telegram.messenger.R
;
...
...
@@ -41,7 +40,7 @@ public class ActionBarMenuItem extends ImageView {
private
LinearLayout
popupLayout
;
private
ActionBarMenu
parentMenu
;
private
PopupWindow
popupWindow
;
private
ActionBar
PopupWindow
popupWindow
;
private
ActionBar
parentActionBar
;
private
EditText
searchField
;
private
boolean
isSearchField
=
false
;
...
...
@@ -120,12 +119,12 @@ public class ActionBarMenuItem extends ImageView {
return
;
}
if
(
popupWindow
==
null
)
{
popupWindow
=
new
PopupWindow
(
popupLayout
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
);
popupWindow
=
new
ActionBar
PopupWindow
(
popupLayout
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
);
popupWindow
.
setFocusable
(
true
);
popupWindow
.
setBackgroundDrawable
(
new
BitmapDrawable
());
popupWindow
.
setOutsideTouchable
(
true
);
popupWindow
.
setClippingEnabled
(
true
);
popupWindow
.
setInputMethodMode
(
PopupWindow
.
INPUT_METHOD_NOT_NEEDED
);
popupWindow
.
setInputMethodMode
(
ActionBar
PopupWindow
.
INPUT_METHOD_NOT_NEEDED
);
popupWindow
.
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_UNSPECIFIED
);
}
if
(
popupLayout
.
getMeasuredWidth
()
==
0
)
{
...
...
@@ -177,7 +176,6 @@ public class ActionBarMenuItem extends ImageView {
searchField
.
setTextSize
(
18
);
searchField
.
setTextColor
(
0xffffffff
);
searchField
.
setSingleLine
(
true
);
searchField
.
setTextIsSelectable
(
false
);
searchField
.
setBackgroundResource
(
R
.
drawable
.
search_light_states
);
searchField
.
setPadding
(
Utilities
.
dp
(
6
),
0
,
Utilities
.
dp
(
6
),
0
);
searchField
.
setInputType
(
EditorInfo
.
TYPE_TEXT_FLAG_NO_SUGGESTIONS
);
...
...
@@ -220,10 +218,11 @@ public class ActionBarMenuItem extends ImageView {
mCursorDrawableRes
.
setAccessible
(
true
);
mCursorDrawableRes
.
set
(
searchField
,
R
.
drawable
.
search_carret
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
//nothing to do
}
if
(
Build
.
VERSION
.
SDK_INT
>=
11
)
{
searchField
.
setImeOptions
(
EditorInfo
.
IME_FLAG_NO_FULLSCREEN
|
EditorInfo
.
IME_ACTION_SEARCH
);
searchField
.
setTextIsSelectable
(
false
);
}
else
{
searchField
.
setImeOptions
(
EditorInfo
.
IME_ACTION_SEARCH
);
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarPopupWindow.java
0 → 100644
View file @
2c61da00
/*
* This is the source code of Telegram for Android v. 1.4.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2014.
*/
//Thanks to https://github.com/JakeWharton/ActionBarSherlock/
package
org
.
telegram
.
ui
.
Views
.
ActionBar
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.view.ViewTreeObserver
;
import
android.widget.PopupWindow
;
import
java.lang.reflect.Field
;
public
class
ActionBarPopupWindow
extends
PopupWindow
{
private
static
final
Field
superListenerField
;
static
{
Field
f
=
null
;
try
{
f
=
PopupWindow
.
class
.
getDeclaredField
(
"mOnScrollChangedListener"
);
f
.
setAccessible
(
true
);
}
catch
(
NoSuchFieldException
e
)
{
/* ignored */
}
superListenerField
=
f
;
}
private
static
final
ViewTreeObserver
.
OnScrollChangedListener
NOP
=
new
ViewTreeObserver
.
OnScrollChangedListener
()
{
@Override
public
void
onScrollChanged
()
{
/* do nothing */
}
};
private
ViewTreeObserver
.
OnScrollChangedListener
mSuperScrollListener
;
private
ViewTreeObserver
mViewTreeObserver
;
public
ActionBarPopupWindow
()
{
super
();
init
();
}
public
ActionBarPopupWindow
(
Context
context
)
{
super
(
context
);
init
();
}
public
ActionBarPopupWindow
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
init
();
}
public
ActionBarPopupWindow
(
Context
context
,
AttributeSet
attrs
,
int
defStyle
)
{
super
(
context
,
attrs
,
defStyle
);
init
();
}
public
ActionBarPopupWindow
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
super
(
context
,
attrs
,
defStyleAttr
,
defStyleRes
);
init
();
}
public
ActionBarPopupWindow
(
int
width
,
int
height
)
{
super
(
width
,
height
);
init
();
}
public
ActionBarPopupWindow
(
View
contentView
)
{
super
(
contentView
);
init
();
}
public
ActionBarPopupWindow
(
View
contentView
,
int
width
,
int
height
,
boolean
focusable
)
{
super
(
contentView
,
width
,
height
,
focusable
);
init
();
}
public
ActionBarPopupWindow
(
View
contentView
,
int
width
,
int
height
)
{
super
(
contentView
,
width
,
height
);
init
();
}
private
void
init
()
{
if
(
superListenerField
!=
null
)
{
try
{
mSuperScrollListener
=
(
ViewTreeObserver
.
OnScrollChangedListener
)
superListenerField
.
get
(
this
);
superListenerField
.
set
(
this
,
NOP
);
}
catch
(
Exception
e
)
{
mSuperScrollListener
=
null
;
}
}
}
private
void
unregisterListener
()
{
// Don't do anything if we haven't managed to patch the super listener
if
(
mSuperScrollListener
!=
null
&&
mViewTreeObserver
!=
null
)
{
if
(
mViewTreeObserver
.
isAlive
())
{
mViewTreeObserver
.
removeOnScrollChangedListener
(
mSuperScrollListener
);
}
mViewTreeObserver
=
null
;
}
}
private
void
registerListener
(
View
anchor
)
{
// Don't do anything if we haven't managed to patch the super listener.
// And don't bother attaching the listener if the anchor view isn't
// attached. This means we'll only have to deal with the real VTO owned
// by the ViewRoot.
if
(
mSuperScrollListener
!=
null
)
{
ViewTreeObserver
vto
=
(
anchor
.
getWindowToken
()
!=
null
)
?
anchor
.
getViewTreeObserver
()
:
null
;
if
(
vto
!=
mViewTreeObserver
)
{
if
(
mViewTreeObserver
!=
null
&&
mViewTreeObserver
.
isAlive
())
{
mViewTreeObserver
.
removeOnScrollChangedListener
(
mSuperScrollListener
);
}
if
((
mViewTreeObserver
=
vto
)
!=
null
)
{
vto
.
addOnScrollChangedListener
(
mSuperScrollListener
);
}
}
}
}
@Override
public
void
showAsDropDown
(
View
anchor
,
int
xoff
,
int
yoff
)
{
super
.
showAsDropDown
(
anchor
,
xoff
,
yoff
);
registerListener
(
anchor
);
}
@Override
public
void
update
(
View
anchor
,
int
xoff
,
int
yoff
,
int
width
,
int
height
)
{
super
.
update
(
anchor
,
xoff
,
yoff
,
width
,
height
);
registerListener
(
anchor
);
}
@Override
public
void
update
(
View
anchor
,
int
width
,
int
height
)
{
super
.
update
(
anchor
,
width
,
height
);
registerListener
(
anchor
);
}
@Override
public
void
showAtLocation
(
View
parent
,
int
gravity
,
int
x
,
int
y
)
{
super
.
showAtLocation
(
parent
,
gravity
,
x
,
y
);
unregisterListener
();
}
@Override
public
void
dismiss
()
{
super
.
dismiss
();
unregisterListener
();
}
}
TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/BaseFragment.java
View file @
2c61da00
...
...
@@ -51,11 +51,11 @@ public class BaseFragment {
}
fragmentView
=
null
;
}
if
(
parentActivity
!=
null
)
{
if
(
actionBarLayer
!=
null
)
{
actionBarLayer
.
onDestroy
();
actionBarLayer
=
null
;
}
if
(
parentActivity
!=
null
)
{
actionBarLayer
=
parentActivity
.
getInternalActionBar
().
createLayer
();
}
}
...
...
@@ -92,7 +92,10 @@ public class BaseFragment {
}
public
void
onPause
()
{
if
(
actionBarLayer
!=
null
)
{
actionBarLayer
.
onPause
();
actionBarLayer
.
closeSearchField
();
}
}
public
void
onConfigurationChanged
(
android
.
content
.
res
.
Configuration
newConfig
)
{
...
...
TMessagesProj/src/main/res/values/styles.xml
View file @
2c61da00
...
...
@@ -8,6 +8,7 @@
<item
name=
"android:colorBackground"
>
@android:color/white
</item>
<item
name=
"android:windowBackground"
>
@android:color/white
</item>
<item
name=
"android:windowContentOverlay"
>
@drawable/shadow
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
</style>
<style
name=
"Theme.TMessages"
parent=
"@android:style/Theme.Holo.Light"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment