forked from signalapp/Signal-Android
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
1,268 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Building Session | ||
=============== | ||
|
||
Basics | ||
------ | ||
|
||
Session uses [Gradle](http://gradle.org) to build the project and to maintain | ||
dependencies. However, you needn't install it yourself; the | ||
"gradle wrapper" `gradlew`, mentioned below, will do that for you. | ||
|
||
Building Session | ||
--------------- | ||
|
||
The following steps should help you (re)build Session from the command line. | ||
|
||
1. Checkout the session-android project source with the command: | ||
|
||
git clone https://github.com/loki-project/session-android.git | ||
|
||
2. Make sure you have the [Android SDK](https://developer.android.com/sdk/index.html) installed. | ||
3. Ensure that the following packages are installed from the Android SDK manager: | ||
* Android SDK Build Tools (see buildToolsVersion in build.gradle) | ||
* SDK Platform (All API levels) | ||
* Android Support Repository | ||
* Google Repository | ||
4. Create a local.properties file at the root of your source checkout and add an sdk.dir entry to it. For example: | ||
|
||
sdk.dir=/Application/android-sdk-macosx | ||
|
||
5. Using Java 8 | ||
|
||
6. Execute Gradle: | ||
|
||
./gradlew build | ||
|
||
Visual assets | ||
---------------------- | ||
|
||
Source assets tend to be large binary blobs, which are best stored outside of git repositories. Some source files are SVGs that can be auto-colored and sized using a tool like [android-res-utils](https://github.com/sebkur/android-res-utils). | ||
|
||
Sample command for generating our audio placeholder image: | ||
|
||
```bash | ||
pngs_from_svg.py ic_audio.svg /path/to/Session/res/ 150 --color #000 --opacity 0.54 --suffix _light | ||
pngs_from_svg.py ic_audio.svg /path/to/Session/res/ 150 --color #fff --opacity 1.00 --suffix _light | ||
``` | ||
|
||
Setting up a development environment | ||
------------------------------------ | ||
|
||
[Android Studio](https://developer.android.com/sdk/installing/studio.html) is the recommended development environment. | ||
|
||
1. Install Android Studio. | ||
2. Open Android Studio. On a new installation, the Quickstart panel will appear. If you have open projects, close them using "File > Close Project" to see the Quickstart panel. | ||
3. From the Quickstart panel, choose "Configure" then "SDK Manager". | ||
4. In the SDK Tools tab of the SDK Manager, make sure that the "Android Support Repository" is installed, and that the latest "Android SDK build-tools" are installed. Click "OK" to return to the Quickstart panel. | ||
5. From the Quickstart panel, choose "Checkout from Version Control" then "git". | ||
6. Paste the URL for the session-android project when prompted (https://github.com/loki-project/session-android.git). | ||
7. Android studio should detect the presence of a project file and ask you whether to open it. Click "yes". | ||
9. Default config options should be good enough. | ||
9. Project initialisation and build should proceed. | ||
|
||
Contributing code | ||
----------------- | ||
|
||
Code contributions should be sent via github as pull requests, from feature branches [as explained here](https://help.github.com/articles/using-pull-requests). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle" > | ||
|
||
<solid | ||
android:color="@color/pn_option_background" /> | ||
|
||
<stroke | ||
android:color="@color/pn_option_border" | ||
android:width="@dimen/border_thickness" /> | ||
|
||
<corners android:radius="@dimen/pn_option_corner_radius" /> | ||
|
||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<transition xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@drawable/pn_option_background_selected" /> | ||
<item android:drawable="@drawable/pn_option_background" /> | ||
</transition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<transition xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@drawable/pn_option_background" /> | ||
<item android:drawable="@drawable/pn_option_background_selected" /> | ||
</transition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle" > | ||
|
||
<solid | ||
android:color="@color/pn_option_background" /> | ||
|
||
<stroke | ||
android:color="@color/accent" | ||
android:width="@dimen/border_thickness" /> | ||
|
||
<corners android:radius="@dimen/pn_option_corner_radius" /> | ||
|
||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@drawable/default_session_background" | ||
android:orientation="vertical"> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1"/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="@dimen/very_large_spacing" | ||
android:layout_marginRight="@dimen/very_large_spacing" | ||
android:textSize="@dimen/very_large_font_size" | ||
android:textStyle="bold" | ||
android:textColor="@color/text" | ||
android:text="@string/activity_pn_mode_title" /> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="@dimen/very_large_spacing" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginRight="@dimen/very_large_spacing" | ||
android:textSize="@dimen/medium_font_size" | ||
android:textColor="@color/text" | ||
android:text="@string/activity_pn_mode_explanation" /> | ||
|
||
<LinearLayout | ||
android:id="@+id/fcmOptionView" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="@dimen/very_large_spacing" | ||
android:layout_marginTop="@dimen/medium_spacing" | ||
android:layout_marginRight="@dimen/very_large_spacing" | ||
android:padding="12dp" | ||
android:orientation="vertical" | ||
android:background="@drawable/pn_option_background"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textSize="@dimen/medium_font_size" | ||
android:textColor="@color/text" | ||
android:textStyle="bold" | ||
android:text="@string/activity_pn_mode_fcm_option_title" /> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="4dp" | ||
android:textSize="@dimen/very_small_font_size" | ||
android:textColor="@color/text" | ||
android:text="@string/activity_pn_mode_fcm_option_explanation" /> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="4dp" | ||
android:textSize="@dimen/very_small_font_size" | ||
android:textColor="@color/accent" | ||
android:textStyle="bold" | ||
android:text="@string/activity_pn_mode_recommended_option_tag" /> | ||
|
||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:id="@+id/backgroundPollingOptionView" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="@dimen/very_large_spacing" | ||
android:layout_marginTop="@dimen/small_spacing" | ||
android:layout_marginRight="@dimen/very_large_spacing" | ||
android:padding="12dp" | ||
android:orientation="vertical" | ||
android:background="@drawable/pn_option_background"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textSize="@dimen/medium_font_size" | ||
android:textColor="@color/text" | ||
android:textStyle="bold" | ||
android:text="@string/activity_pn_mode_background_polling_option_title" /> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="4dp" | ||
android:textSize="@dimen/very_small_font_size" | ||
android:textColor="@color/text" | ||
android:text="@string/activity_pn_mode_background_polling_option_explanation" /> | ||
|
||
</LinearLayout> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1"/> | ||
|
||
<Button | ||
style="@style/MediumProminentFilledButton" | ||
android:id="@+id/registerButton" | ||
android:layout_width="match_parent" | ||
android:layout_height="@dimen/medium_button_height" | ||
android:layout_marginLeft="@dimen/massive_spacing" | ||
android:layout_marginRight="@dimen/massive_spacing" | ||
android:layout_marginBottom="@dimen/medium_spacing" | ||
android:text="Continue" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.