Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit abc75bb

Browse files
authored
Merge branch 'master' into arrowBranch
2 parents a97409e + 203f07a commit abc75bb

File tree

58 files changed

+2249
-542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2249
-542
lines changed

.travis.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ android:
1111
- platform-tools
1212

1313
# The BuildTools version used by your project
14-
- build-tools-23.0.2
14+
- build-tools-25.0.2
1515

1616
# The SDK version used to compile your project
17-
- android-24
17+
- android-25
1818

1919
# Additional components
2020
- extra-google-google_play_services
@@ -40,3 +40,9 @@ android:
4040
script:
4141
- ./gradlew lintDebug
4242
- ./gradlew assembleDebug
43+
notifications:
44+
webhooks:
45+
urls:
46+
- https://zulip.org/zulipbot/travis
47+
on_success: always
48+
on_failure: always

README.rst

+17-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@
44
Zulip for Android
55
=================
66

7-
This is the Android client for `Zulip <http://www.zulip.org>`_. It is
7+
**Note**: We've decided that our `React Native app`_ is far enough
8+
along that it makes sense to focus our efforts on making the React
9+
Native app better on Android and iOS rather than continuing to split
10+
our effort developing two similar apps in parallel. Hence, for GSoC we
11+
will be focused on making the React Native app awesome. The plan is in
12+
this `document`_, which also covers important FAQ for anyone
13+
interested in doing GSoC on Zulip mobile apps.
14+
15+
.. _React Native app: https://github.com/zulip/zulip-mobile
16+
.. _document: https://github.com/zulip/zulip-android/blob/master/android-strategy.md
17+
18+
---------------
19+
20+
This is the native Android client for `Zulip <http://www.zulip.org>`_. It is
821
available `in the Google Play store
922
<https://play.google.com/store/apps/details?id=com.zulip.android>`_.
1023
If you have a taste for adventure, you can also `join our beta channel
@@ -225,7 +238,7 @@ Another way to connect android device to local server is via adb
225238

226239
- Run ``adb reverse tcp:9991 tcp:9991`` in terminal
227240

228-
- Connect to local server by entering url (**http://127.0.0.0.1:9991**) in app
241+
- Connect to local server by entering url (**http://127.0.0.1:9991**) in app
229242

230243
.. _here: https://github.com/zulip/zulip/blob/1c40df9363b70af0e275c44a03f9627808852616/Vagrantfile#L37
231244
.. _Host Remapping: http://docs.telerik.com/fiddler/KnowledgeBase/HOSTS
@@ -241,8 +254,8 @@ Contributing
241254
* For commit messages, be sure to checkout our `commit message style guidelines`_.
242255

243256
* For code style, please read the `Zulip coding style`_ conventions carefully.
244-
245-
.. |@zulipbot| replace:: **@zulipbot**
257+
258+
.. |@zulipbot| replace:: **@zulipbot**
246259
.. _@zulipbot: https://github.com/zulip/zulipbot
247260
.. _commit message style guidelines: https://zulip.readthedocs.io/en/latest/version-control.html#commit-messages
248261
.. _Zulip coding style: https://zulip.readthedocs.org/en/latest/code-style.html#version-control
@@ -290,4 +303,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
290303
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
291304
See the License for the specific language governing permissions and
292305
limitations under the License.
293-

android-strategy.md

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Zulip Android plan
2+
3+
We are merging the Zulip Android and iOS development communities, to
4+
focus on the React Native app codebase (zulip-mobile.git). We’ve
5+
found with the iOS React Native project that we’ve been able to build
6+
an app that performs well using the platform, and the benefits of
7+
being able to share a codebase (so that we only have to implement each
8+
feature and design each detail once) are huge, and outweigh the
9+
advantages of continuing to invest in the existing, more mature Java
10+
Android app.
11+
12+
So, in preparation for Google Summer of Code applications opening on
13+
March 20th, we’re planning to merge the communities now so that we can
14+
direct students interested in Android to propose projects for the
15+
React Native app. Our goal is to have the best possible Zulip Android
16+
app by the end of the summer, and we think the best way to achieve
17+
that is to combine the efforts of both the Zulip iOS/React Native
18+
developers and the Zulip Java/Android development team on a single app
19+
codebase. This will also as a side effect benefit both the iOS app
20+
and potential future apps for other React-Native supported platforms
21+
like Windows Phone.
22+
23+
Here’s how this will work practically:
24+
25+
- The Java Android app will remain in the app store until the React
26+
Native app is good enough to completely replace it. This probably
27+
means 3-6 months, depending how quickly RN development goes. We’ll
28+
continue doing releases both to fix bugs and to roll out features
29+
that are already partially implemented, but want to avoid putting a
30+
lot of work into totally new features for the Java app.
31+
- Folks who have open PRs on the Java Android app should work on
32+
finishing them so that we can close out those features. It’s still
33+
super valuable.
34+
- The goal is to get the React Native app to be better than the Java
35+
Android app as fast as possible (probably by end of August at the
36+
latest), so that we can minimize total work.
37+
- This Android strategy means it doesn’t make sense for us to have
38+
GSoC projects working on the Java Android app; those students would
39+
be able to help Zulip more working on the React Native app. So
40+
students who were planning to do GSoC with the Java Android project
41+
should write their proposals for improvements to the React Native
42+
app instead. A few important details are worth highlighting:
43+
- Zulip’s GSoC selection process is focused more on general
44+
engineering skills and approach than specific language knowledge, so
45+
good work done on the Java Android app is just as valuable for your
46+
application as work done on the React Native app.
47+
- Good engineers can learn new tools and languages, so if you’re shown
48+
your skills well on the Java project, we’re confident you’ll be able
49+
to effectively contribute to the React Native project after a bit of
50+
learning time. Students are encouraged to start learning React
51+
Native and contributing to the React Native app now to help prepare
52+
for a successful summer.
53+
- Proposals should highlight any work done on either app as well as
54+
describe a plan for the improvements they want to make to the React
55+
Native app over the summer.
56+
57+
58+
Logistical details checklist for migration:
59+
60+
* [x] Make sure all existing Java contributors understand the plan and
61+
can give feedback on it and this plan.
62+
* [x] Announce on chat.zulip.org
63+
* [ ] Update GSoC ideas page to clarify the plan
64+
* [ ] Update zulip/zulip-mobile README.md
65+
* [x] Update zulip/zulip-android README.md
66+
* [ ] Update zulip/zulip README.md
67+
* [ ] Email zulip-devel@ and zulip-ios@ and zulip-android@ with the
68+
announcement
69+
* [ ] Announce on Twitter @zuliposs, linking to email
70+
* [ ] Use @zulipbot to update open PRs and issues for Android app with
71+
a heads-up about the plan
72+
73+
Logistical details that can be follow-up items but are important to
74+
making the transition successful:
75+
76+
* [ ] Get the Zulip RN app working on Android (main issue is
77+
implementing the scrolling extension)
78+
79+
* [ ] Attempt to clear out Java Android open PRs and open bugs to buy
80+
us 3-6 months of time without major development to the Java Android
81+
app, since it may take a while for the React Native app to achieve
82+
feature/quality parity.
83+
84+
* [ ] Audit features of Java Android app and open issues for them in
85+
the RN app project.
86+
* [ ] Audit open issues for feature ideas in the Java Android app and
87+
open corresponding ones in the RN app project.
88+
* [ ] Add a bunch of links to JS, React, and RN tutorials to the RN app docs
89+
* [ ] Create good onboarding docs for RN for developers who only have Linux (and no Mac).
90+
* [ ] Move/rename/merge, as appropriate, the Zulip mobile mailing lists
91+

app/build.gradle

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ repositories {
1616

1717

1818
android {
19-
compileSdkVersion 24
19+
compileSdkVersion 25
2020
//noinspection GradleDependency
21-
buildToolsVersion "23.0.2"
21+
buildToolsVersion "25.0.2"
2222
defaultConfig {
2323
applicationId "com.zulip.android"
2424
minSdkVersion 13
2525
//noinspection OldTargetApi
26-
targetSdkVersion 23
26+
targetSdkVersion 25
2727

2828
versionCode 27
2929
versionName "1.2.1"
@@ -67,9 +67,9 @@ android {
6767
}
6868

6969
dependencies {
70-
compile 'com.android.support:appcompat-v7:24.1.1'
71-
compile 'com.android.support:design:24.1.1'
72-
compile 'com.android.support:recyclerview-v7:24.1.1'
70+
compile 'com.android.support:appcompat-v7:25.1.1'
71+
compile 'com.android.support:design:25.1.1'
72+
compile 'com.android.support:recyclerview-v7:25.1.1'
7373
compile 'com.google.android.gms:play-services-gcm:8.4.0'
7474
compile 'com.google.android.gms:play-services-auth:8.4.0'
7575
compile 'com.squareup.retrofit2:retrofit:2.2.0'
@@ -82,11 +82,11 @@ dependencies {
8282
compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
8383
compile 'com.squareup.picasso:picasso:2.5.2'
8484
//noinspection GradleCompatible
85-
compile 'com.android.support:customtabs:23.3.0'
85+
compile 'com.android.support:customtabs:25.1.1'
8686
compile 'com.github.bumptech.glide:glide:3.7.0'
87-
compile 'com.android.support:support-v4:24.1.0'
87+
compile 'com.android.support:support-v4:25.1.1'
8888
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
89-
compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
89+
compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
9090
transitive = true;
9191
}
9292

@@ -102,7 +102,7 @@ dependencies {
102102
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.2') {
103103
exclude group: 'com.android.support'
104104
}
105-
androidTestCompile('com.android.support:support-annotations:24.1.1') {
105+
androidTestCompile('com.android.support:support-annotations:25.1.1') {
106106
exclude group: 'com.android.support'
107107
}
108108

app/lint.xml

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<lint>
3-
<issue id="GradleDependency" severity="ignore"/>
4-
<issue id="GradleDynamicVersion" severity="ignore"/>
5-
<issue id="GradleOverrides" severity="ignore"/>
6-
<issue id="OldTargetApi" severity="ignore"/>
3+
<issue id="GradleDependency" severity="ignore" />
4+
<issue id="GradleDynamicVersion" severity="ignore" />
5+
<issue id="GradleOverrides" severity="ignore" />
6+
<issue id="OldTargetApi" severity="ignore" />
77
<!-- Change the severity of hardcoded strings to "error"
88
when #260 is merged-->
99
<issue id="HardcodedText" severity="ignore" />
10-
<issue id="IconDensities" severity="ignore"/>
11-
<issue id="InvalidPackage" severity="ignore"/>
10+
<issue id="IconDensities" severity="ignore" />
11+
<issue id="InvalidPackage" severity="ignore" />
1212
<issue id="UnusedResources" severity="error">
13-
<ignore path="**/ic_person_24dp.png"/>
14-
<ignore path="**/ic_search_24dp.png"/>
13+
<ignore path="**/ic_person_24dp.png" />
14+
<ignore path="**/ic_search_24dp.png" />
1515
</issue>
16-
<issue id="UnusedNamespace" severity="error"/>
17-
<issue id="UnusedAttribute" severity="error"/>
18-
<issue id="Deprecated" severity="error"/>
19-
<issue id="Typos" severity="error"/>
20-
<issue id="SdCardPath" severity="error"/>
21-
<issue id="NewerVersionAvailable" severity="error"/>
16+
<issue id="UnusedNamespace" severity="error" />
17+
<issue id="UnusedAttribute" severity="error" />
18+
<issue id="Deprecated" severity="error" />
19+
<issue id="Typos" severity="error" />
20+
<issue id="SdCardPath" severity="error" />
21+
<issue id="NewerVersionAvailable" severity="error" />
2222
</lint>

app/src/main/AndroidManifest.xml

+9-12
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@
2222
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
2323
<uses-permission android:name="android.permission.VIBRATE" />
2424

25-
<uses-sdk android:targetSdkVersion="23" android:minSdkVersion="13"
26-
tools:overrideLibrary="com.android.support:customtabs:23.3.0,android.support.customtabs"/>
25+
<uses-sdk
26+
android:minSdkVersion="13"
27+
android:targetSdkVersion="23"
28+
tools:overrideLibrary="com.android.support:customtabs:23.3.0,android.support.customtabs" />
2729

2830
<application
2931
android:name=".ZulipApp"
3032
android:allowBackup="false"
3133
android:icon="@drawable/ic_launcher"
3234
android:label="@string/app_name"
33-
android:theme="@style/AppTheme.DayNight.NoActionBar"
3435
android:supportsRtl="false"
36+
android:theme="@style/AppTheme.DayNight.NoActionBar"
3537
tools:ignore="GoogleAppIndexingWarning">
3638
<provider
3739
android:name="android.support.v4.content.FileProvider"
@@ -50,27 +52,22 @@
5052
android:launchMode="singleTask">
5153
<intent-filter>
5254
<action android:name="android.intent.action.MAIN" />
53-
5455
<category android:name="android.intent.category.LAUNCHER" />
5556
</intent-filter>
5657
<intent-filter>
5758
<action android:name="android.intent.action.SEND" />
58-
5959
<category android:name="android.intent.category.DEFAULT" />
60-
61-
<data android:mimeType="image/*" />
60+
<data android:mimeType="*/*" />
6261
</intent-filter>
6362
</activity>
6463
<activity
6564
android:name=".activities.LoginActivity"
66-
android:label="@string/app_name"
67-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
68-
</activity>
65+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
66+
android:label="@string/app_name"></activity>
6967
<activity
7068
android:name=".activities.PhotoViewActivity"
7169
android:parentActivityName=".activities.ZulipActivity"
72-
tools:ignore="UnusedAttribute">
73-
</activity>
70+
tools:ignore="UnusedAttribute"></activity>
7471
<activity
7572
android:name=".activities.LegalActivity"
7673
android:label="@string/title_activity_legal" />

app/src/main/assets/legal.html

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
white-space: pre-wrap;
99
word-wrap: break-word;
1010
}
11+
1112
</style>
1213
</head>
1314
<body>

app/src/main/java/com/zulip/android/ZulipApp.java

+26-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.zulip.android.models.Emoji;
3131
import com.zulip.android.models.Message;
3232
import com.zulip.android.models.MessageType;
33+
import com.zulip.android.models.PeopleDrawerList;
3334
import com.zulip.android.models.Person;
3435
import com.zulip.android.models.Presence;
3536
import com.zulip.android.models.Stream;
@@ -89,6 +90,11 @@ public class ZulipApp extends Application {
8990
* every couple of seconds
9091
*/
9192
public final Queue<Integer> unreadMessageQueue = new ConcurrentLinkedQueue<>();
93+
/**
94+
* Map of recent PM person with their email
95+
* Updated when new private message is arrived
96+
*/
97+
public final Map<String, PeopleDrawerList> recentPMPersons = new ConcurrentHashMap<>();
9298
// This object's intrinsic lock is used to prevent multiple threads from
9399
// making conflicting updates to ranges
94100
public Object updateRangeLock = new Object();
@@ -99,6 +105,7 @@ public class ZulipApp extends Application {
99105
private int max_message_id;
100106
private DatabaseHelper databaseHelper;
101107
private ZulipServices zulipServices;
108+
private ZulipServices uploadServices;
102109
private ReferenceObjectCache objectCache;
103110
private ZulipActivity zulipActivity;
104111
/**
@@ -210,6 +217,22 @@ public void setZulipServices(ZulipServices zulipServices) {
210217
this.zulipServices = zulipServices;
211218
}
212219

220+
public ZulipServices getUploadServices() {
221+
if (uploadServices == null) {
222+
HttpLoggingInterceptor logging = new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.HEADERS);
223+
uploadServices = new Retrofit.Builder()
224+
.client(new OkHttpClient.Builder().readTimeout(60, TimeUnit.SECONDS)
225+
.addInterceptor(new ZulipInterceptor())
226+
.addInterceptor(logging)
227+
.build())
228+
.addConverterFactory(GsonConverterFactory.create(getGson()))
229+
.baseUrl(getServerURI())
230+
.build()
231+
.create(ZulipServices.class);
232+
}
233+
return uploadServices;
234+
}
235+
213236
public Gson getGson() {
214237
if (gson == null) {
215238
gson = buildGson();
@@ -328,6 +351,8 @@ private void setupEmoji() {
328351
new Callable<Void>() {
329352
public Void call() throws Exception {
330353
for (String newEmoji : emojis) {
354+
//currently emojis are in png format
355+
newEmoji = newEmoji.replace(".png", "");
331356
dao.create(new Emoji(newEmoji));
332357
}
333358
return null;
@@ -408,7 +433,7 @@ public void logOut() {
408433
ed.apply();
409434
this.api_key = null;
410435
setEventQueueId(null);
411-
436+
recentPMPersons.clear();
412437
new GoogleAuthHelper().logOutGoogleAuth();
413438
}
414439

0 commit comments

Comments
 (0)