Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
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
AloqaIM-Android
Commits
cf7b024b
Commit
cf7b024b
authored
Nov 05, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
respect ShortVariable, ShortMethodName rules for PMD
parent
9bb20414
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
81 additions
and
74 deletions
+81
-74
LaunchUtil.java
app/src/main/java/chat/rocket/android/LaunchUtil.java
+3
-3
AbstractFragmentActivity.java
...hat/rocket/android/activity/AbstractFragmentActivity.java
+9
-6
ServerConfigActivity.java
...va/chat/rocket/android/activity/ServerConfigActivity.java
+9
-9
InputHostnameFragment.java
...android/fragment/server_config/InputHostnameFragment.java
+3
-3
TextUtils.java
app/src/main/java/chat/rocket/android/helper/TextUtils.java
+1
-0
MeteorLoginServiceConfiguration.java
...rocket/android/model/MeteorLoginServiceConfiguration.java
+1
-0
ServerConfig.java
...src/main/java/chat/rocket/android/model/ServerConfig.java
+3
-2
RocketChatService.java
...n/java/chat/rocket/android/service/RocketChatService.java
+11
-11
RocketChatWebSocketThread.java
...hat/rocket/android/service/RocketChatWebSocketThread.java
+18
-18
AbstractDDPDocEventSubscriber.java
...service/ddp_subscriber/AbstractDDPDocEventSubscriber.java
+3
-3
AbstractCustomFontTextView.java
.../chat/rocket/android/view/AbstractCustomFontTextView.java
+2
-2
TypefaceHelper.java
...rc/main/java/chat/rocket/android/view/TypefaceHelper.java
+5
-5
WaitingView.java
app/src/main/java/chat/rocket/android/view/WaitingView.java
+9
-8
RocketChatWebSocketAPI.java
...n/java/chat/rocket/android/ws/RocketChatWebSocketAPI.java
+2
-2
pmd-ruleset.xml
config/quality/pmd/pmd-ruleset.xml
+2
-2
No files found.
app/src/main/java/chat/rocket/android/LaunchUtil.java
View file @
cf7b024b
...
@@ -10,12 +10,12 @@ import chat.rocket.android.activity.ServerConfigActivity;
...
@@ -10,12 +10,12 @@ import chat.rocket.android.activity.ServerConfigActivity;
*/
*/
public
class
LaunchUtil
{
public
class
LaunchUtil
{
/**
/**
* launc ServerConfigActivity with proper flags.
* launc
h
ServerConfigActivity with proper flags.
*/
*/
public
static
void
showServerConfigActivity
(
Context
context
,
String
i
d
)
{
public
static
void
showServerConfigActivity
(
Context
context
,
String
serverCondigI
d
)
{
Intent
intent
=
new
Intent
(
context
,
ServerConfigActivity
.
class
);
Intent
intent
=
new
Intent
(
context
,
ServerConfigActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_REORDER_TO_FRONT
|
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_REORDER_TO_FRONT
|
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
);
intent
.
putExtra
(
"id"
,
i
d
);
intent
.
putExtra
(
"id"
,
serverCondigI
d
);
context
.
startActivity
(
intent
);
context
.
startActivity
(
intent
);
}
}
}
}
app/src/main/java/chat/rocket/android/activity/AbstractFragmentActivity.java
View file @
cf7b024b
...
@@ -12,21 +12,24 @@ abstract class AbstractFragmentActivity extends AppCompatActivity {
...
@@ -12,21 +12,24 @@ abstract class AbstractFragmentActivity extends AppCompatActivity {
@Override
@Override
public
void
onBackPressed
()
{
public
void
onBackPressed
()
{
Fragment
f
=
getSupportFragmentManager
().
findFragmentById
(
getLayoutContainerForFragment
());
Fragment
fragment
=
if
(
f
instanceof
OnBackPressListener
&&
((
OnBackPressListener
)
f
).
onBackPressed
())
{
getSupportFragmentManager
().
findFragmentById
(
getLayoutContainerForFragment
());
if
(
fragment
instanceof
OnBackPressListener
&&
((
OnBackPressListener
)
fragment
).
onBackPressed
())
{
//consumed. do nothing.
//consumed. do nothing.
}
else
super
.
onBackPressed
();
}
else
super
.
onBackPressed
();
}
}
protected
void
showFragment
(
Fragment
f
)
{
protected
void
showFragment
(
Fragment
f
ragment
)
{
getSupportFragmentManager
().
beginTransaction
()
getSupportFragmentManager
().
beginTransaction
()
.
replace
(
getLayoutContainerForFragment
(),
f
)
.
replace
(
getLayoutContainerForFragment
(),
f
ragment
)
.
commit
();
.
commit
();
}
}
protected
void
showFragmentWithBackStack
(
Fragment
f
)
{
protected
void
showFragmentWithBackStack
(
Fragment
f
ragment
)
{
getSupportFragmentManager
().
beginTransaction
()
getSupportFragmentManager
().
beginTransaction
()
.
replace
(
getLayoutContainerForFragment
(),
f
)
.
replace
(
getLayoutContainerForFragment
(),
f
ragment
)
.
addToBackStack
(
null
)
.
addToBackStack
(
null
)
.
commit
();
.
commit
();
}
}
...
...
app/src/main/java/chat/rocket/android/activity/ServerConfigActivity.java
View file @
cf7b024b
...
@@ -161,22 +161,22 @@ public class ServerConfigActivity extends AbstractFragmentActivity {
...
@@ -161,22 +161,22 @@ public class ServerConfigActivity extends AbstractFragmentActivity {
}
}
@Override
@Override
protected
void
showFragment
(
Fragment
f
)
{
protected
void
showFragment
(
Fragment
f
ragment
)
{
injectIdArgTo
(
f
);
injectIdArgTo
(
f
ragment
);
super
.
showFragment
(
f
);
super
.
showFragment
(
f
ragment
);
}
}
@Override
@Override
protected
void
showFragmentWithBackStack
(
Fragment
f
)
{
protected
void
showFragmentWithBackStack
(
Fragment
f
ragment
)
{
injectIdArgTo
(
f
);
injectIdArgTo
(
f
ragment
);
super
.
showFragmentWithBackStack
(
f
);
super
.
showFragmentWithBackStack
(
f
ragment
);
}
}
private
void
injectIdArgTo
(
Fragment
f
)
{
private
void
injectIdArgTo
(
Fragment
f
ragment
)
{
Bundle
args
=
f
.
getArguments
();
Bundle
args
=
f
ragment
.
getArguments
();
if
(
args
==
null
)
args
=
new
Bundle
();
if
(
args
==
null
)
args
=
new
Bundle
();
args
.
putString
(
"id"
,
mServerConfigId
);
args
.
putString
(
"id"
,
mServerConfigId
);
f
.
setArguments
(
args
);
f
ragment
.
setArguments
(
args
);
}
}
@Override
@Override
...
...
app/src/main/java/chat/rocket/android/fragment/server_config/InputHostnameFragment.java
View file @
cf7b024b
...
@@ -41,7 +41,7 @@ public class InputHostnameFragment extends AbstractServerConfigFragment {
...
@@ -41,7 +41,7 @@ public class InputHostnameFragment extends AbstractServerConfigFragment {
@Override
@Override
protected
void
onSetupView
()
{
protected
void
onSetupView
()
{
mRootView
.
findViewById
(
R
.
id
.
btn_connect
).
setOnClickListener
(
v
->
handleConnect
());
mRootView
.
findViewById
(
R
.
id
.
btn_connect
).
setOnClickListener
(
v
iew
->
handleConnect
());
mObserver
.
sub
();
mObserver
.
sub
();
}
}
...
@@ -83,8 +83,8 @@ public class InputHostnameFragment extends AbstractServerConfigFragment {
...
@@ -83,8 +83,8 @@ public class InputHostnameFragment extends AbstractServerConfigFragment {
private
void
showError
(
String
errString
)
{
private
void
showError
(
String
errString
)
{
mShowError
.
removeMessages
(
0
);
mShowError
.
removeMessages
(
0
);
Message
m
=
Message
.
obtain
(
mShowError
,
0
,
errString
);
Message
m
sg
=
Message
.
obtain
(
mShowError
,
0
,
errString
);
mShowError
.
sendMessageDelayed
(
m
,
160
);
mShowError
.
sendMessageDelayed
(
m
sg
,
160
);
}
}
private
void
onRenderServerConfig
(
ServerConfig
config
)
{
private
void
onRenderServerConfig
(
ServerConfig
config
)
{
...
...
app/src/main/java/chat/rocket/android/helper/TextUtils.java
View file @
cf7b024b
...
@@ -18,6 +18,7 @@ public class TextUtils {
...
@@ -18,6 +18,7 @@ public class TextUtils {
/**
/**
* Returns str if it is not empty; otherwise defaultValue is returned.
* Returns str if it is not empty; otherwise defaultValue is returned.
*/
*/
@SuppressWarnings
(
"PMD.ShortMethodName"
)
public
static
CharSequence
or
(
CharSequence
str
,
CharSequence
defaultValue
)
{
public
static
CharSequence
or
(
CharSequence
str
,
CharSequence
defaultValue
)
{
if
(
isEmpty
(
str
))
return
defaultValue
;
if
(
isEmpty
(
str
))
return
defaultValue
;
return
str
;
return
str
;
...
...
app/src/main/java/chat/rocket/android/model/MeteorLoginServiceConfiguration.java
View file @
cf7b024b
...
@@ -6,6 +6,7 @@ import io.realm.annotations.PrimaryKey;
...
@@ -6,6 +6,7 @@ import io.realm.annotations.PrimaryKey;
/**
/**
* subscription model for "meteor_accounts_loginServiceConfiguration"
* subscription model for "meteor_accounts_loginServiceConfiguration"
*/
*/
@SuppressWarnings
(
"PMD.ShortVariable"
)
public
class
MeteorLoginServiceConfiguration
extends
RealmObject
{
public
class
MeteorLoginServiceConfiguration
extends
RealmObject
{
@PrimaryKey
@PrimaryKey
private
String
id
;
private
String
id
;
...
...
app/src/main/java/chat/rocket/android/model/ServerConfig.java
View file @
cf7b024b
...
@@ -15,6 +15,7 @@ import jp.co.crowdworks.realm_java_helpers_bolts.RealmHelperBolts;
...
@@ -15,6 +15,7 @@ import jp.co.crowdworks.realm_java_helpers_bolts.RealmHelperBolts;
/**
/**
* Server configuration
* Server configuration
*/
*/
@SuppressWarnings
(
"PMD.ShortVariable"
)
public
class
ServerConfig
extends
RealmObject
{
public
class
ServerConfig
extends
RealmObject
{
@PrimaryKey
@PrimaryKey
private
String
id
;
private
String
id
;
...
@@ -99,12 +100,12 @@ public class ServerConfig extends RealmObject {
...
@@ -99,12 +100,12 @@ public class ServerConfig extends RealmObject {
}
}
@DebugLog
@DebugLog
public
static
void
logError
(
String
id
,
Exception
e
)
{
public
static
void
logError
(
String
id
,
Exception
e
xception
)
{
RealmHelperBolts
RealmHelperBolts
.
executeTransaction
(
realm
->
.
executeTransaction
(
realm
->
realm
.
createOrUpdateObjectFromJson
(
ServerConfig
.
class
,
new
JSONObject
()
realm
.
createOrUpdateObjectFromJson
(
ServerConfig
.
class
,
new
JSONObject
()
.
put
(
"id"
,
id
)
.
put
(
"id"
,
id
)
.
put
(
"connectionError"
,
e
.
getMessage
())))
.
put
(
"connectionError"
,
e
xception
.
getMessage
())))
.
continueWith
(
new
LogcatIfError
());
.
continueWith
(
new
LogcatIfError
());
}
}
}
}
app/src/main/java/chat/rocket/android/service/RocketChatService.java
View file @
cf7b024b
...
@@ -66,22 +66,22 @@ public class RocketChatService extends Service {
...
@@ -66,22 +66,22 @@ public class RocketChatService extends Service {
}
}
private
void
syncWebSocketThreadsWith
(
List
<
ServerConfig
>
configList
)
{
private
void
syncWebSocketThreadsWith
(
List
<
ServerConfig
>
configList
)
{
final
Iterator
<
Map
.
Entry
<
String
,
RocketChatWebSocketThread
>>
it
=
final
Iterator
<
Map
.
Entry
<
String
,
RocketChatWebSocketThread
>>
it
erator
=
mWebSocketThreads
.
entrySet
().
iterator
();
mWebSocketThreads
.
entrySet
().
iterator
();
while
(
it
.
hasNext
())
{
while
(
it
erator
.
hasNext
())
{
Map
.
Entry
<
String
,
RocketChatWebSocketThread
>
e
=
it
.
next
();
Map
.
Entry
<
String
,
RocketChatWebSocketThread
>
e
ntry
=
iterator
.
next
();
String
id
=
e
.
getKey
();
String
serverConfigId
=
entry
.
getKey
();
boolean
found
=
false
;
boolean
found
=
false
;
for
(
ServerConfig
config:
configList
)
{
for
(
ServerConfig
config:
configList
)
{
if
(
i
d
.
equals
(
config
.
getId
()))
{
if
(
serverConfigI
d
.
equals
(
config
.
getId
()))
{
found
=
true
;
found
=
true
;
break
;
break
;
}
}
}
}
if
(!
found
)
{
if
(!
found
)
{
RocketChatWebSocketThread
.
terminate
(
e
.
getValue
());
RocketChatWebSocketThread
.
terminate
(
e
ntry
.
getValue
());
it
.
remove
();
it
erator
.
remove
();
}
}
}
}
...
@@ -95,13 +95,13 @@ public class RocketChatService extends Service {
...
@@ -95,13 +95,13 @@ public class RocketChatService extends Service {
}
}
private
Task
<
RocketChatWebSocketThread
>
findOrCreateWebSocketThread
(
final
ServerConfig
config
)
{
private
Task
<
RocketChatWebSocketThread
>
findOrCreateWebSocketThread
(
final
ServerConfig
config
)
{
final
String
i
d
=
config
.
getId
();
final
String
serverConfigI
d
=
config
.
getId
();
if
(
mWebSocketThreads
.
containsKey
(
i
d
))
{
if
(
mWebSocketThreads
.
containsKey
(
serverConfigI
d
))
{
return
Task
.
forResult
(
mWebSocketThreads
.
get
(
i
d
));
return
Task
.
forResult
(
mWebSocketThreads
.
get
(
serverConfigI
d
));
}
else
{
}
else
{
return
RocketChatWebSocketThread
.
getStarted
(
getApplicationContext
(),
config
)
return
RocketChatWebSocketThread
.
getStarted
(
getApplicationContext
(),
config
)
.
onSuccessTask
(
task
->
{
.
onSuccessTask
(
task
->
{
mWebSocketThreads
.
put
(
i
d
,
task
.
getResult
());
mWebSocketThreads
.
put
(
serverConfigI
d
,
task
.
getResult
());
return
task
;
return
task
;
});
});
}
}
...
...
app/src/main/java/chat/rocket/android/service/RocketChatWebSocketThread.java
View file @
cf7b024b
...
@@ -29,9 +29,9 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -29,9 +29,9 @@ public class RocketChatWebSocketThread extends HandlerThread {
private
boolean
mSocketExists
;
private
boolean
mSocketExists
;
private
boolean
mListenersRegistered
;
private
boolean
mListenersRegistered
;
private
RocketChatWebSocketThread
(
Context
appContext
,
String
i
d
)
{
private
RocketChatWebSocketThread
(
Context
appContext
,
String
serverConfigI
d
)
{
super
(
"RC_thread_"
+
i
d
);
super
(
"RC_thread_"
+
serverConfigI
d
);
mServerConfigId
=
i
d
;
mServerConfigId
=
serverConfigI
d
;
mAppContext
=
appContext
;
mAppContext
=
appContext
;
}
}
...
@@ -48,8 +48,8 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -48,8 +48,8 @@ public class RocketChatWebSocketThread extends HandlerThread {
try
{
try
{
super
.
onLooperPrepared
();
super
.
onLooperPrepared
();
task
.
setResult
(
this
);
task
.
setResult
(
this
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
xception
)
{
task
.
setError
(
e
);
task
.
setError
(
e
xception
);
}
}
}
}
}.
start
();
}.
start
();
...
@@ -60,8 +60,8 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -60,8 +60,8 @@ public class RocketChatWebSocketThread extends HandlerThread {
* terminate the thread
* terminate the thread
*/
*/
@DebugLog
@DebugLog
public
static
void
terminate
(
RocketChatWebSocketThread
t
)
{
public
static
void
terminate
(
RocketChatWebSocketThread
t
hread
)
{
t
.
quit
();
t
hread
.
quit
();
}
}
private
Task
<
Void
>
ensureConnection
()
{
private
Task
<
Void
>
ensureConnection
()
{
...
@@ -178,12 +178,12 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -178,12 +178,12 @@ public class RocketChatWebSocketThread extends HandlerThread {
Object
obj
=
ctor
.
newInstance
(
mAppContext
,
mWebSocketAPI
);
Object
obj
=
ctor
.
newInstance
(
mAppContext
,
mWebSocketAPI
);
if
(
obj
instanceof
Registerable
)
{
if
(
obj
instanceof
Registerable
)
{
Registerable
l
=
(
Registerable
)
obj
;
Registerable
registerable
=
(
Registerable
)
obj
;
l
.
register
();
registerable
.
register
();
mListeners
.
add
(
l
);
mListeners
.
add
(
registerable
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
xception
)
{
Timber
.
w
(
e
,
"Failed to register listeners!!"
);
Timber
.
w
(
e
xception
,
"Failed to register listeners!!"
);
}
}
}
}
}
}
...
@@ -192,18 +192,18 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -192,18 +192,18 @@ public class RocketChatWebSocketThread extends HandlerThread {
private
void
keepaliveListeners
()
{
private
void
keepaliveListeners
()
{
if
(!
mSocketExists
||
!
mListenersRegistered
)
return
;
if
(!
mSocketExists
||
!
mListenersRegistered
)
return
;
for
(
Registerable
l
:
mListeners
)
l
.
keepalive
();
for
(
Registerable
registerable
:
mListeners
)
registerable
.
keepalive
();
}
}
//@DebugLog
//@DebugLog
private
void
unregisterListeners
()
{
private
void
unregisterListeners
()
{
if
(!
mSocketExists
||
!
mListenersRegistered
)
return
;
if
(!
mSocketExists
||
!
mListenersRegistered
)
return
;
Iterator
<
Registerable
>
it
=
mListeners
.
iterator
();
Iterator
<
Registerable
>
it
erator
=
mListeners
.
iterator
();
while
(
it
.
hasNext
())
{
while
(
it
erator
.
hasNext
())
{
Registerable
l
=
it
.
next
();
Registerable
registerable
=
iterator
.
next
();
l
.
unregister
();
registerable
.
unregister
();
it
.
remove
();
it
erator
.
remove
();
}
}
if
(
mWebSocketAPI
!=
null
)
{
if
(
mWebSocketAPI
!=
null
)
{
mWebSocketAPI
.
close
();
mWebSocketAPI
.
close
();
...
...
app/src/main/java/chat/rocket/android/service/ddp_subscriber/AbstractDDPDocEventSubscriber.java
View file @
cf7b024b
...
@@ -103,9 +103,9 @@ abstract class AbstractDDPDocEventSubscriber implements Registerable {
...
@@ -103,9 +103,9 @@ abstract class AbstractDDPDocEventSubscriber implements Registerable {
}
}
private
void
mergeJSON
(
JSONObject
target
,
JSONObject
src
)
throws
JSONException
{
private
void
mergeJSON
(
JSONObject
target
,
JSONObject
src
)
throws
JSONException
{
Iterator
<
String
>
it
=
src
.
keys
();
Iterator
<
String
>
it
erator
=
src
.
keys
();
while
(
it
.
hasNext
())
{
while
(
it
erator
.
hasNext
())
{
String
key
=
it
.
next
();
String
key
=
it
erator
.
next
();
target
.
put
(
key
,
src
.
get
(
key
));
target
.
put
(
key
,
src
.
get
(
key
));
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/view/AbstractCustomFontTextView.java
View file @
cf7b024b
...
@@ -33,8 +33,8 @@ abstract class AbstractCustomFontTextView extends AppCompatTextView {
...
@@ -33,8 +33,8 @@ abstract class AbstractCustomFontTextView extends AppCompatTextView {
private
void
init
()
{
private
void
init
()
{
String
font
=
getFont
();
String
font
=
getFont
();
if
(
font
!=
null
)
{
if
(
font
!=
null
)
{
Typeface
t
f
=
TypefaceHelper
.
getTypeface
(
getContext
(),
font
);
Typeface
t
ypeface
=
TypefaceHelper
.
getTypeface
(
getContext
(),
font
);
if
(
t
f
!=
null
)
setTypeface
(
tf
);
if
(
t
ypeface
!=
null
)
setTypeface
(
typeface
);
}
}
}
}
}
}
app/src/main/java/chat/rocket/android/view/TypefaceHelper.java
View file @
cf7b024b
...
@@ -18,16 +18,16 @@ public class TypefaceHelper {
...
@@ -18,16 +18,16 @@ public class TypefaceHelper {
/**
/**
* read font in assets directory.
* read font in assets directory.
*/
*/
public
static
Typeface
getTypeface
(
Context
c
,
String
assetPath
)
{
public
static
Typeface
getTypeface
(
Context
c
ontext
,
String
assetPath
)
{
synchronized
(
CACHE
)
{
synchronized
(
CACHE
)
{
if
(!
CACHE
.
containsKey
(
assetPath
))
{
if
(!
CACHE
.
containsKey
(
assetPath
))
{
try
{
try
{
Typeface
t
=
Typeface
.
createFromAsset
(
c
.
getAssets
(),
Typeface
t
ypeface
=
Typeface
.
createFromAsset
(
context
.
getAssets
(),
assetPath
);
assetPath
);
CACHE
.
put
(
assetPath
,
t
);
CACHE
.
put
(
assetPath
,
t
ypeface
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
xception
)
{
Log
.
e
(
TAG
,
"Could not get typeface '"
+
assetPath
Log
.
e
(
TAG
,
"Could not get typeface '"
+
assetPath
+
"' because "
+
e
.
getMessage
());
+
"' because "
+
e
xception
.
getMessage
());
return
null
;
return
null
;
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/view/WaitingView.java
View file @
cf7b024b
...
@@ -48,12 +48,12 @@ public class WaitingView extends LinearLayout {
...
@@ -48,12 +48,12 @@ public class WaitingView extends LinearLayout {
int
count
=
3
;
int
count
=
3
;
if
(
attrs
!=
null
)
{
if
(
attrs
!=
null
)
{
TypedArray
a
=
context
.
getTheme
().
obtainStyledAttributes
(
TypedArray
a
rray
=
context
.
getTheme
().
obtainStyledAttributes
(
attrs
,
attrs
,
R
.
styleable
.
WaitingView
,
0
,
0
);
R
.
styleable
.
WaitingView
,
0
,
0
);
size
=
a
.
getDimensionPixelSize
(
R
.
styleable
.
WaitingView_dotSize
,
size
);
size
=
a
rray
.
getDimensionPixelSize
(
R
.
styleable
.
WaitingView_dotSize
,
size
);
count
=
a
.
getInteger
(
R
.
styleable
.
WaitingView_dotCount
,
count
);
count
=
a
rray
.
getInteger
(
R
.
styleable
.
WaitingView_dotCount
,
count
);
a
.
recycle
();
a
rray
.
recycle
();
}
}
mDots
=
new
ArrayList
<>();
mDots
=
new
ArrayList
<>();
...
@@ -74,13 +74,14 @@ public class WaitingView extends LinearLayout {
...
@@ -74,13 +74,14 @@ public class WaitingView extends LinearLayout {
}
}
private
void
addDot
(
Context
context
,
int
size
)
{
private
void
addDot
(
Context
context
,
int
size
)
{
FrameLayout
f
=
new
FrameLayout
(
context
);
FrameLayout
frameLayout
=
new
FrameLayout
(
context
);
f
.
setLayoutParams
(
new
LinearLayoutCompat
.
LayoutParams
(
size
*
3
/
2
,
size
*
3
/
2
));
frameLayout
.
setLayoutParams
(
new
LinearLayoutCompat
.
LayoutParams
(
size
*
3
/
2
,
size
*
3
/
2
));
ImageView
dot
=
new
ImageView
(
context
);
ImageView
dot
=
new
ImageView
(
context
);
dot
.
setImageResource
(
R
.
drawable
.
white_circle
);
dot
.
setImageResource
(
R
.
drawable
.
white_circle
);
dot
.
setLayoutParams
(
new
FrameLayout
.
LayoutParams
(
size
,
size
,
Gravity
.
CENTER
));
dot
.
setLayoutParams
(
new
FrameLayout
.
LayoutParams
(
size
,
size
,
Gravity
.
CENTER
));
f
.
addView
(
dot
);
f
rameLayout
.
addView
(
dot
);
addView
(
f
);
addView
(
f
rameLayout
);
mDots
.
add
(
dot
);
mDots
.
add
(
dot
);
}
}
...
...
app/src/main/java/chat/rocket/android/ws/RocketChatWebSocketAPI.java
View file @
cf7b024b
...
@@ -62,8 +62,8 @@ public class RocketChatWebSocketAPI {
...
@@ -62,8 +62,8 @@ public class RocketChatWebSocketAPI {
/**
/**
* Unsubscribe with DDP client.
* Unsubscribe with DDP client.
*/
*/
public
Task
<
DDPSubscription
.
NoSub
>
unsubscribe
(
final
String
i
d
)
{
public
Task
<
DDPSubscription
.
NoSub
>
unsubscribe
(
final
String
subscriptionI
d
)
{
return
mDDPClient
.
unsub
(
i
d
);
return
mDDPClient
.
unsub
(
subscriptionI
d
);
}
}
/**
/**
...
...
config/quality/pmd/pmd-ruleset.xml
View file @
cf7b024b
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
<rule
ref=
"rulesets/java/naming.xml"
>
<rule
ref=
"rulesets/java/naming.xml"
>
<!--<exclude name="AbstractNaming" />-->
<!--<exclude name="AbstractNaming" />-->
<exclude
name=
"LongVariable"
/>
<exclude
name=
"LongVariable"
/>
<
exclude
name=
"ShortMethodName"
/
>
<
!--exclude name="ShortMethodName" /--
>
<
exclude
name=
"ShortVariable"
/
>
<
!--exclude name="ShortVariable" /--
>
<!--<exclude name="ShortClassName" />-->
<!--<exclude name="ShortClassName" />-->
<!--<exclude name="VariableNamingConventions" />-->
<!--<exclude name="VariableNamingConventions" />-->
</rule>
</rule>
...
...
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