Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asfFix email not saved #11

Open
wants to merge 207 commits into
base: oauth-patch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
eea829e
Change to ExpandableListView in XML
kunall17 Jul 12, 2016
7fe6a3f
Removed Old StreamsDrawerCode
kunall17 Jul 12, 2016
679e8fd
Setup the expandable listView adapter
kunall17 Jul 19, 2016
0136f51
Set View Binder to bind the views with data
kunall17 Jul 19, 2016
e76eaf7
Narrow on child Click for the expandable listView
kunall17 Jul 19, 2016
decba2e
Narrow to stream on group expand/collapse click
kunall17 Jul 19, 2016
8765494
Hide soft keyboard when LoginActivity starts
kunall17 Jul 14, 2016
6a59ebf
Temporarily strip out Crashlytics
lfaraone Jul 25, 2016
54f690d
Bump gradle dependency to latest.
lfaraone Jul 25, 2016
df40a32
Release 0.8.10
lfaraone Jul 25, 2016
bcea8d7
Merge branch 'lfaraone-rel0.8.10'
lfaraone Jul 25, 2016
8f77a16
Release 0.8.11
lfaraone Jul 26, 2016
a2ae147
Removed Use zulip.com checkbox
kunall17 Jul 20, 2016
620bec9
Add links to Google Play store. (#107)
brainwane Aug 1, 2016
b8e2d0c
Merge branch 'lfaraone-rel0.8.11'
lfaraone Aug 1, 2016
e4bfa47
Add User-Agent header
kunall17 Aug 2, 2016
eebc7d8
Upgrade OkHttp dependency from version 3.3.1 to 3.4.1
kunall17 Aug 2, 2016
83c306c
Removed some old repeated code at above
kunall17 Jul 28, 2016
e3ad98b
Change EditText to AutoCompleteTextView
kunall17 Jul 28, 2016
7f28efb
Create a database table for the emojis
kunall17 Jul 28, 2016
8cc0bff
Populate Emoji database table
kunall17 Jul 28, 2016
f0be056
Setup the adapter which switches the cursor for emoji or people
kunall17 Jul 28, 2016
7eaacdc
Setup a ViewBinder for the Adapter
kunall17 Jul 28, 2016
c20085e
Bump up DATABASE_VERSION to create new tables for emoji in the existi…
kunall17 Aug 1, 2016
3165ce3
Add/replace new emojis
kunall17 Aug 1, 2016
99787d9
Leave the database open after onCreate
niftynei Aug 2, 2016
4122adf
Implement Animation Helper class to have methods for animation
kunall17 Jul 26, 2016
06d996e
Implement PushTask to get backends from server
kunall17 Jul 26, 2016
1ffface
Implement Change screens in LoginActivity
kunall17 Jul 26, 2016
60895b5
Fix: Legal Button
kunall17 Jul 31, 2016
7ca4f58
Change To recycler in XML
kunall17 Jul 8, 2016
1fdfc96
Recycler View Message Adapter
kunall17 Jul 8, 2016
da4c6f3
Removed old adapter
kunall17 Jul 8, 2016
4be7320
Setup new recycler message adapter
kunall17 Jul 8, 2016
e06a3db
Setup list's and add new message Header parent
kunall17 Jul 8, 2016
828fc47
onCreateViewHolder method for the adapter
kunall17 Jul 8, 2016
8994b37
Implement onBindViewHolder
kunall17 Jul 8, 2016
0f42d51
Implement Picasso for loading gravatar
kunall17 Jul 8, 2016
47fce03
Implement bind TimeStamp to the holder
kunall17 Jul 8, 2016
ab5965c
Implement Getter's for different objects
kunall17 Jul 8, 2016
d593004
Mark message read when View Holder is attached
kunall17 Jul 8, 2016
2d93f0a
Setup Header and footer loading views
kunall17 Jul 15, 2016
65ad327
Setup Click Listener's for the Views
kunall17 Jul 15, 2016
88af578
Moved getFormattedContent to the message class
kunall17 Jul 8, 2016
a8d6594
Removed Unused/old code in fragment
kunall17 Jul 8, 2016
3727b46
Implement recyclerview and adapter in fragment
kunall17 Jul 8, 2016
2a938f5
Changed code for ScrollListener for recyclerView
kunall17 Jul 8, 2016
b21876f
Change in muteTopic in ZulipActivity
kunall17 Jul 8, 2016
3127fe2
Implement ItemDecoration for spacing between messageHeaders
kunall17 Jul 8, 2016
090eae1
Show toast on new messages loaded
kunall17 Jul 16, 2016
a57919b
Show scrollbars in the recyclerView
kunall17 Jul 15, 2016
5ddf729
Filter by today's messages
kunall17 Jul 15, 2016
d786b39
Move ChatBox to another xml
kunall17 Jul 21, 2016
845f442
Coordinator Behaviour to hide views on scroll
kunall17 Jul 21, 2016
3b3ce36
Implement Floating ActionButton
kunall17 Jul 21, 2016
2bffded
Hide FAB after 5 sec
kunall17 Jul 21, 2016
f68ec55
Click listener on FAB for showing chatbox
kunall17 Jul 21, 2016
2574423
Display ChatBox onNarrow and hide FAB
kunall17 Jul 21, 2016
9fa33a3
Do not hide Chatbox if currently chatBox is used
kunall17 Jul 21, 2016
759795b
Hide ChatBox on scroll
kunall17 Jul 21, 2016
76fe9b7
Removed redundant FrameLayout parent
kunall17 Jul 21, 2016
822cd21
Add toolbar space to top
kunall17 Jul 24, 2016
93d71d7
Hide/Show header/footer loading views
kunall17 Jul 24, 2016
7f36ce5
Add new messages to new headers
kunall17 Jul 24, 2016
cd4b4d3
Add margin to the bottommost message
kunall17 Jul 31, 2016
6db2bf0
Implement TextView for showing message
kunall17 Jul 26, 2016
8ef9793
Show EmptyView if no messages
kunall17 Jul 26, 2016
2ae2c8f
Set httpScheme according to debug or production
kunall17 Aug 4, 2016
82ac093
Show dialog to confirm for http in production builds
kunall17 Aug 4, 2016
a5cbeae
Fetch backends using the httpScheme
kunall17 Aug 4, 2016
9ca6222
Implement TextView for showing message
kunall17 Jul 26, 2016
dc1ab37
Actually use https if you select it from the dialog
niftynei Aug 12, 2016
e8f4da9
Remove spammy logging in notifications
niftynei Aug 12, 2016
0c0d7ce
Fix merge issue
niftynei Aug 12, 2016
0d6ecc5
Only allow 1 stream to be expanded
kunall17 Aug 4, 2016
802f45d
Hide keyboard on Narrow
kunall17 Aug 11, 2016
1a7d0d3
Bump version to 0.9.0
niftynei Aug 12, 2016
965e4a9
Add an option to overflow menu to switch menu
kunall17 Jul 28, 2016
bf31ce7
Implement a night theme XML
kunall17 Jul 28, 2016
0106191
Add night drawables and change drawables name
kunall17 Jul 28, 2016
2ea0228
Convert hardcoded colors to be changed when Theme changes
kunall17 Aug 11, 2016
0f7aef1
Change colors in RecyclerMessageAdapter
kunall17 Aug 11, 2016
edab3e4
Use @string resources instead of hardcoded text
kunall17 Aug 10, 2016
b10cabf
Remove unused resources
kunall17 Aug 10, 2016
8790b3b
Make private fields
kunall17 Aug 10, 2016
e494dbf
Removed unused imports
kunall17 Aug 10, 2016
c3b8534
Simplify If statements
kunall17 Aug 10, 2016
ba74e0c
Change StringBuffer to StringBuilder
kunall17 Aug 10, 2016
87bf4e4
Simplify same catch blocks
kunall17 Aug 10, 2016
50c9ee7
 Explicit type argument's replaced with <>
kunall17 Aug 10, 2016
7afcbd7
Collapse empty XML tags
kunall17 Aug 10, 2016
e1f4285
Removed unecessary background in root elements
kunall17 Aug 10, 2016
a52305d
Reformat code
kunall17 Aug 10, 2016
3a904a4
Bump up gradle dependencies versions
kunall17 Aug 10, 2016
f58a25d
Add an option to overflow menu to switch menu
kunall17 Jul 28, 2016
82b19ef
Convert hardcoded colors to be changed when Theme changes
kunall17 Aug 11, 2016
060e80d
Remove extraneous string from bad merge
niftynei Aug 16, 2016
aa15fc3
Fix on narrow to private message
kunall17 Aug 13, 2016
32faaeb
Fix: multiple asyncGetEvents
kunall17 Aug 16, 2016
a5149c0
Make private fields
kunall17 Aug 10, 2016
d021a97
Create blank drawable if no emoji present
kunall17 Aug 12, 2016
ee256e6
Ignore gradle.properties
niftynei Aug 17, 2016
c48cb87
Add Crashlytics tracking
niftynei Aug 17, 2016
1a0fc36
Fix narrowing to a stream by touching it in message lists.
kunall17 Aug 18, 2016
f921a62
Release 0.9.1.
timabbott Aug 19, 2016
5ec7739
JavaDocs for classes
kunall17 Aug 22, 2016
dc8aca0
JavaDocs for methods
kunall17 Aug 22, 2016
e426b47
Custom matchers for the espresso tests
kunall17 Aug 21, 2016
66ddde9
Custom ViewAssertions for the espresso tests
kunall17 Aug 21, 2016
6612688
Modified BaseTest to support the new login flow
kunall17 Aug 21, 2016
29b2938
Modified LoginDevAuthTest to support the new login flow
kunall17 Aug 21, 2016
c80ce15
Implemented new test for the new recyclerView UI
kunall17 Aug 21, 2016
671b449
Rename ChatBoxTest to RecyclerViewTests
kunall17 Aug 21, 2016
edecb88
Fixes: #131 Show Title and name in header if narrowed to self PM's
kunall17 Aug 18, 2016
703b0c7
Rename hideFABBlocked to make it more clear and stop recyclerView scr…
kunall17 Aug 22, 2016
ad68c73
Fixes #134: Change ChatBox container to a custom view and listen for …
kunall17 Aug 22, 2016
b408aef
Do not hide FAB if chatBox is visible
kunall17 Aug 22, 2016
526f349
Add an animation to hide the chatBox on swipe
kunall17 Aug 22, 2016
271c3c0
Remove references of humbughq from GCM messaging
niftynei Aug 12, 2016
a93948e
Remove humbug references from variable names
niftynei Aug 12, 2016
016995e
Fix bug for the mutedMessages
kunall17 Aug 21, 2016
c986800
Fixes #131: Messages order same as web UI
kunall17 Aug 23, 2016
192414d
Fixup the docs according to this new method
kunall17 Aug 23, 2016
a018889
Modified Readme
kunall17 Aug 23, 2016
e7d9c50
Implement TextView for unread counts to streams drawer rows
kunall17 Aug 12, 2016
ce9a9ab
Get unread messages count in subjects
kunall17 Aug 12, 2016
dae195c
Get unread messages from streams in cursor
kunall17 Aug 12, 2016
54d020e
Bind unread counts to streams and topics
kunall17 Aug 12, 2016
a85e255
Bind unread counts from cursor to textView
kunall17 Aug 12, 2016
b45e1b0
Bump DATABASE_VERSION for new column read messases columns in message…
kunall17 Aug 15, 2016
20eeb03
New unread column in message mode
kunall17 Aug 15, 2016
a71b09c
Mark message as read and save in database
kunall17 Aug 15, 2016
3d7e9f4
Check for unread field in count
kunall17 Aug 15, 2016
e3b9fd7
Modify childClickListener in streamsDrawer to listen for clicks
kunall17 Aug 23, 2016
8dd1eb0
Update the streamsDrawer whenever drawer is opened
kunall17 Aug 23, 2016
b699a25
Widget AppProvider XML Info
kunall17 Aug 16, 2016
f1f1295
AppWidgetProvider and Layout XML
kunall17 Aug 16, 2016
85c2288
AppWidgetProvider receiver in Manifest
kunall17 Aug 17, 2016
9bf562c
Widget Configuration Activity
kunall17 Aug 16, 2016
e24c443
RemoteViewsFactory for containing and displaying the message list
kunall17 Aug 16, 2016
626a970
Bind Messages to listView
kunall17 Aug 16, 2016
03de63f
Setup the date filter for fetching messages
kunall17 Aug 16, 2016
bf8c90f
Setup AsycGetEvents in ZulipWidget
kunall17 Aug 17, 2016
2d484b2
Setup interval in AsyncGetEvents
kunall17 Aug 17, 2016
25c93f5
Prevent adding new messages to Main Activity adapter if started from …
kunall17 Aug 16, 2016
c6ab9bf
If new messages are recieved then update the widget
kunall17 Aug 16, 2016
baf801b
Setup a clickPendingIntent for the refresh button
kunall17 Aug 16, 2016
d5f2ffc
Update version to 0.9.2.
timabbott Aug 24, 2016
59ab30a
Race condition prevention and attempting to catch thread violations f…
koziodigitalinc Aug 25, 2016
a1382b5
Added some crashlytics logging for potential breadcrumbs on failure.
koziodigitalinc Aug 25, 2016
be23bbc
changed from empty string to null in case of failure in requests. Con…
koziodigitalinc Aug 25, 2016
ec55f27
Login orientation persistance added, stops login from reseting on rot…
oorosc Aug 23, 2016
b0eb964
docs: Remove duplicate Index heading.
timabbott Aug 27, 2016
b551763
docs: Clean up getting started instructions and fix link.
timabbott Aug 27, 2016
965ec73
build.gradle: Add Google Client ID for Google auth.
timabbott Aug 10, 2016
b8ce7e0
Fixed silent error shown on crashlytics. Network response is now chec…
koziodigitalinc Aug 23, 2016
b47e223
Fix regression with string/toString
niftynei Sep 10, 2016
3898a33
Issue #168 bugfix for links not being clickable, adds autoLink featur…
kenodoggy Sep 9, 2016
1ab6b28
Remove static import per comments
kenodoggy Sep 9, 2016
029e886
#168 fix method documentation
kenodoggy Sep 9, 2016
33575a7
Initialize user tag text color
kunall17 Jul 20, 2016
41c025d
Get All users from the database
kunall17 Jul 20, 2016
5974fa7
Implement ClickableSpan for user mentions
kunall17 Jul 20, 2016
99ae2a3
Always show AppBarLayout onNarrow
kunall17 Aug 17, 2016
22fb0d0
Show another color if the user is mentioned
kunall17 Aug 17, 2016
a694de8
Fix null reference bug
niftynei Sep 10, 2016
1e194d5
Retrofit work begins, ZulipServices and dependencies.
oorosc Aug 23, 2016
93ac4ef
Backend fetch and Login are working now.
koziodigitalinc Aug 25, 2016
73fa384
Deserialization for GetEvents is now working
koziodigitalinc Aug 26, 2016
6126271
MEssages request works now
koziodigitalinc Aug 27, 2016
b0f37f5
Updated based on comments
koziodigitalinc Sep 8, 2016
e370c9b
Fixed up logic regarding error responses for event queue's in Async g…
koziodigitalinc Sep 9, 2016
263e874
Issue #168 bugfix for links not being clickable, adds autoLink featur…
kenodoggy Sep 9, 2016
acf9e3a
Remove static import per comments
kenodoggy Sep 9, 2016
01eaa90
Implement ClickableSpan for user mentions
kunall17 Jul 20, 2016
33aaf8b
Fix bad rebase
niftynei Sep 10, 2016
7d42d60
Add links to google groups for issues
kunall17 Sep 5, 2016
e2e325e
docs: Clarify getting started and help recommendations.
timabbott Sep 14, 2016
88b1d9f
Reorder build.gradle file to increase readablity
niftynei Sep 20, 2016
946a329
Tighten up lines
niftynei Sep 20, 2016
7016fcc
README: Expand missing Google auth setup documentation.
Sep 17, 2016
a421cf7
README: Add instructions for using a proxy server for Internet access.
Sep 26, 2016
6c47173
Fixes: #187 Ask for HTTP/HTTPS for non-prod builds
kunall17 Sep 30, 2016
958e3e8
Add missing @FormUrlEncoded annotation in ZulipServices interface
Sam1301 Sep 30, 2016
1ce3d6f
Fix person.java throwing an exception when person details are empty.
Swati4star Oct 1, 2016
18e839f
Shrink font size in compose message box.
minervapanda Oct 6, 2016
7799e30
Make compose box behave similarly on all modes.
Oct 6, 2016
9ebe4e3
Update gradle dependencies
niftynei Sep 22, 2016
d43dc68
Move everything to a new 'MutedTopics' class
niftynei Sep 20, 2016
48d0256
Refactor muted topics to use single class
niftynei Sep 22, 2016
d91667d
Clean up AsyncGetEvents (and fix a bug)
niftynei Sep 22, 2016
ec897ba
Add Toast message when message is copied
minervapanda Oct 10, 2016
6f0d643
Add a secondary error path for networking problems
niftynei Oct 11, 2016
b2eef80
Log out user when receive a 401 Unauthorized
niftynei Oct 11, 2016
c9855cf
Enforce use of onSuccess & onError in subclasses
niftynei Oct 11, 2016
6adf3b5
Change "couldn't fetch" fallback avator
Sam1301 Oct 9, 2016
cb89888
Add method for returning the server url without the API extension
niftynei Oct 12, 2016
4856893
For avatars, add hostname if not provided
niftynei Oct 12, 2016
641d568
Fix up issue where sender data was not being saved for messages
niftynei Oct 12, 2016
966dc7a
Fixes #91
niftynei Oct 12, 2016
bbe0e5c
Allow users to reply to self, fixes #132
niftynei Oct 12, 2016
ca52918
Pressing a sender name will open reply, fixes #93
niftynei Oct 12, 2016
5301d96
Update read flags and pointer
Sam1301 Oct 11, 2016
516daa2
Fixes #172
niftynei Oct 12, 2016
87cf423
Fix #175 - properly save email for Google Auth logins
niftynei Oct 13, 2016
f4af317
Add note for failed logins on dev auth screen
niftynei Oct 13, 2016
3ffe36e
Clean up ZulipActivity start
niftynei Oct 13, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ res/values/com_crashlytics_export_strings.xml
*.iml
.idea

app/gradle.properties

# mac files
.DS_Store
139 changes: 135 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,86 @@


=================
Zulip for Android
=================

This is the Android client for `Zulip <http://www.zulip.org>`_. It is
available `in the Google Play store
<https://play.google.com/store/apps/details?id=com.zulip.android>`_.
If you have a taste for adventure, you can also `join our beta channel
<https://play.google.com/apps/testing/com.zulip.android>`_ after which
the Play store should auto-update you. (Caution: beta releases will
have more bugs than final releases, including (potentially) security
or data loss bugs.)

This is a Gradle project, and can be built via the provided ``gradlew``
or by using Android Studio.

**Index**
---------------


- `Getting Started`_
- `Getting Help`_
- `Build instructions (Android Studio)`_)
- `Build instructions (without Android Studio)`_)
- `Running server on device`_
- `Coding Style`_
- `Mailing List`_
- `Export`_
- `License`_

.. _Getting Started: #getting-started
.. _Getting Help: #getting-help
.. _Build instructions (Android Studio): #build-instructions-android-studio
.. _Build instructions (without Android Studio): #build-instructions-without-android-studio
.. _Running server on device: #browsing-server-on-device
.. _Coding Style: #coding-style
.. _Mailing List: #mailing-list
.. _Export: #export
.. _License: #license

Getting Started
---------------

- First, clone this repository and follow the Android Studio build
instructions (below) to compile the project. If you don't have an
existing Zulip account to login with, you can create one on the
Zulip development community server at https://zulip.tabbott.net/.
Note that this server is used for development discussions, so don't
use it for sending lots of test messages!

- For testing, it can be helpful to have your own Zulip development
server that the app can connect to. Instructions for setting up a
Zulip development server are here:
http://zulip.readthedocs.io/en/latest/dev-overview.html

- And then follow the `Connecting to a development server`_ guide to get the
Android app to connect to the Zulip development server.

.. _Connecting to a development server: #connecting-to-a-development-server

Getting Help
---------------

- For real-time help, you can join the Zulip development community's
Zulip server at https://zulip.tabbott.net and post on the `android`
stream.

- For questions on development for the Zulip Android App you can post here:
https://groups.google.com/forum/#!forum/zulip-android

- For questions on development for the Zulip Server you can post here:
https://groups.google.com/forum/#!forum/zulip-devel

Any issues or bugs should be posted in the Github Issue Tracker!


Build instructions (Android Studio)
-----------------------------------

0. Fork the zulip-android repository from GitHub and clone your fork.

1. Open the project in the IDE.
a) From the "Welcome to Android Studio" menu, select "Open an
existing Android Studio project" option, or
Expand All @@ -16,10 +89,17 @@ Build instructions (Android Studio)
2. If you want to test Google sign in, add the required metadata:
1. Go to https://developers.google.com/mobile/add?platform=android
2. Type in "Zulip" as "App name" and "com.zulip.android" as
"Android package name".)
3. Put the generated file in the "app/" directory of the project.
4. Google app id. You will also get it from the above given link.
This id should be written as the following string resource in
"Android package name" and continue to Choose and configure services.
3. Select the "Google Sign-In" service, you'll need to provide the
SHA-1 of your signing certificate. For that, first follow the manual instructions
to Sign Your Release Build and generate a new Key Store
if you haven't already:
https://developer.android.com/studio/publish/app-signing.html#release-mode
4. Use keytool to get the SHA-1 fingerprint of the certificate:
``keytool -exportcert -list -v \ -alias <your-key-name> -keystore <path-to-production-keystore>``
5. Put the generated file in the "app/" directory of the project.
6. Get your Google app id from the Google Developer console, and
add it as the following string resource in
``app/src/main/res/values/strings.xml``::
<string name="google_app_id">GOOGLE_APP_ID</string>

Expand Down Expand Up @@ -91,6 +171,56 @@ Build instructions (without Android Studio)
default because it is unsigned. You will be told the APK cannot be
parsed.

Connecting to a development server
----------------------------------

Once you are running a Zulip development server on your laptop, you
will need to do some additional configuration of the Android
development environment to connect to your development server.

| If you are using a Genymotion Emulator you can access the server by
browsing to http://10.0.3.2:9991 or http://10.0.3.1:9991 (one of these
two URL’s)

To access the vagrant server on a physical device:

* connect the computer and Android device to the same network (router)

* modify ``VagrantFile`` `here`_ in the server change the host\_ip
‘127.0.0.1’ to ‘0.0.0.0’ Like this-

config.vm.network “forwarded\_port”, guest: 9991, host: host\_port,
host\_ip: “0.0.0.0”

* Now find the IP address of the computer, and start the Android app.
For the server, specify the computer's IP address and port number as
the Zulip Server. For example:

192.168.0.1:9991

Note that if you have internet access on your android device through
a proxy server, you might have to use a VPN application like `this
one`_ to connect to the server.

| You can also route the IP address to a domain name like
www.local.test.com (this routing is useful when testing the Google OAuth
Backend)
| No need to modify the ``VagrantFile`` to achieve this

- Remap the hosts by fiddler by adding this line in TOOLS> HOSTS

localhost:9991 www.local.test.com

If unclear you can follow tutorial here `Host Remapping`_

- Now configure your android device following `this`_ detailed tutorial

.. _here: https://github.com/zulip/zulip/blob/1c40df9363b70af0e275c44a03f9627808852616/Vagrantfile#L37
.. _Host Remapping: http://docs.telerik.com/fiddler/KnowledgeBase/HOSTS
.. _this one: https://play.google.com/store/apps/details?id=com.psiphon3&hl=en
.. _this: http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureForAndroid


Coding Style
------------

Expand Down Expand Up @@ -141,3 +271,4 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

52 changes: 39 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}


android {
compileSdkVersion 24
Expand All @@ -8,8 +23,8 @@ android {
minSdkVersion 13
targetSdkVersion 23

versionCode 11
versionName "0.8.9"
versionCode 19
versionName "0.9.2"

testApplicationId "com.zulip.android.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
Expand All @@ -26,15 +41,17 @@ android {
buildTypes {
debug {
applicationIdSuffix '.dev'
manifestPlaceholders = [ permissionPackage : "com.humbughq.mobile.dev"]
manifestPlaceholders = [ fabricKey : ""]
ext.enableCrashlytics = false
buildConfigField "String", "GOOGLE_CLIENT_ID", "\"659545034376-78hg5hmrvqr50nn53t0nme97ndhqjmvs.apps.googleusercontent.com\""
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
manifestPlaceholders = [ permissionPackage : "com.humbughq.mobile"]
buildConfigField "String", "GOOGLE_CLIENT_ID", "TODO: FILL THIS IN"
manifestPlaceholders = [ fabricKey : project.property("fabricKey")]
buildConfigField "String", "GOOGLE_CLIENT_ID", "\"835904834568-77mtr5mtmpgspj9b051del9i9r5t4g4n.apps.googleusercontent.com\""
}

}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_7
Expand All @@ -44,16 +61,24 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.j256.ormlite:ormlite-core:5.0'
compile 'com.j256.ormlite:ormlite-android:5.0'
compile 'commons-lang:commons-lang:2.6'
compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
compile files('libs/crashlytics.jar')
compile 'com.squareup.picasso:picasso:2.5.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
transitive = true;
}

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude group: 'com.android.support'
}
Expand All @@ -66,11 +91,12 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.2') {
exclude group: 'com.android.support'
}
androidTestCompile('com.android.support:support-annotations:24.0.0') {
androidTestCompile('com.android.support:support-annotations:24.1.1') {
exclude group: 'com.android.support'
}

testCompile 'junit:junit:4.12'
compile 'com.squareup.okhttp3:okhttp:3.3.1'

}

apply plugin: 'com.google.gms.google-services'
Binary file removed app/libs/crashlytics.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

import android.support.test.espresso.Root;
import android.support.test.espresso.ViewInteraction;
import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;

import com.zulip.android.R;
import com.zulip.android.ToastMatcher;
import com.zulip.android.ZulipApp;
import com.zulip.android.util.ZLog;

import org.hamcrest.Matcher;
import org.junit.Before;
Expand Down Expand Up @@ -38,6 +39,7 @@ public class BaseTest {

private static final String PASSWORD_TEST = "yourpasswordhere";
private static final String EMAIL_TEST = "iago@zulip.com";
public static final String SERVER_URL = "www.local.test.com";

@Rule
public ActivityTestRule<ZulipActivity> mActivityTestRule = new ActivityTestRule<>(ZulipActivity.class);
Expand All @@ -53,7 +55,22 @@ public void setUp() {
public void WrongLoginPasswordToast() {
if (ZulipApp.get().getApiKey() != null) {
logout();
try {
Thread.sleep(4000);
} catch (InterruptedException e) {
ZLog.logException(e);
}
}

//Fill Server URL
ViewInteraction serverURLInteraction = onView(allOf(withId(R.id.server_url_in), isDisplayed()));
serverURLInteraction.perform(replaceText(SERVER_URL));

//Click Enter server URL
ViewInteraction enterServerUrl = onView(allOf(withId(R.id.server_btn), withText(R.string.enter), isDisplayed()));
enterServerUrl.perform(click());


//Fill Username
ViewInteraction usernameVI = onView(
allOf(withId(R.id.username), isDisplayed()));
Expand All @@ -78,6 +95,23 @@ public static Matcher<Root> isToast() {

@Test
public void logout() {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
ZLog.logException(e);
}
mActivityTestRule.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
mActivityTestRule.getActivity().showView(mActivityTestRule.getActivity().findViewById(R.id.appBarLayout));
}
});
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
ZLog.logException(e);
}

//Open overflow menu
openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext());

Expand All @@ -88,21 +122,28 @@ public void logout() {
assertNull(ZulipApp.get().getApiKey());
}

@Test
public void login() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
ZLog.logException(e);
}

//Fill Server URL
ViewInteraction serverURLInteraction = onView(allOf(withId(R.id.server_url_in), isDisplayed()));
serverURLInteraction.perform(replaceText(SERVER_URL));

//Click Enter server URL
ViewInteraction enterServerUrl = onView(allOf(withId(R.id.server_btn), withText(R.string.enter), isDisplayed()));
enterServerUrl.perform(click());

//Fill Username
ViewInteraction usernameVI = onView(
allOf(withId(R.id.username), isDisplayed()));
ViewInteraction usernameVI = onView(allOf(withId(R.id.username), isDisplayed()));
usernameVI.perform(replaceText(EMAIL_TEST));

//Fill Password
ViewInteraction passwordVI = onView(
allOf(withId(R.id.password), isDisplayed()));
ViewInteraction passwordVI = onView(allOf(withId(R.id.password), isDisplayed()));
passwordVI.perform(replaceText(PASSWORD_TEST));

//Click Login
Expand Down
Loading