initial commit
BIN
app/src/main/res/drawable/avatar_default.png
Normal file
After Width: | Height: | Size: 208 B |
BIN
app/src/main/res/drawable/avatar_error.png
Normal file
After Width: | Height: | Size: 356 B |
BIN
app/src/main/res/drawable/boost_icon.png
Normal file
After Width: | Height: | Size: 221 B |
9
app/src/main/res/drawable/splash_background.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/gray" />
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
</item>
|
||||
</layer-list>
|
6
app/src/main/res/drawable/status_divider.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<size android:height="1dp" />
|
||||
<solid android:color="#ff000000" />
|
||||
</shape>
|
53
app/src/main/res/layout/activity_login.xml
Normal file
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.keylesspalace.tusky.LoginActivity">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="4dp"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true">
|
||||
|
||||
<EditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPersonName"
|
||||
android:text="Domain"
|
||||
android:ems="10"
|
||||
android:id="@+id/edit_text_domain" />
|
||||
|
||||
<Button
|
||||
android:text="LOG IN"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/button_login"
|
||||
android:layout_centerHorizontal="false"
|
||||
android:layout_centerInParent="false" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/text_error" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
36
app/src/main/res/layout/activity_main.xml
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/activity_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
tools:context="com.keylesspalace.tusky.MainActivity"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="4dp"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
|
||||
|
||||
<android.support.v4.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
79
app/src/main/res/layout/item_status.xml
Normal file
|
@ -0,0 +1,79 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/status_boosted"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toRightOf="@+id/status_boosted_icon"
|
||||
android:layout_toEndOf="@+id/status_boosted_icon"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/boost_icon"
|
||||
android:id="@+id/status_boosted_icon"
|
||||
android:adjustViewBounds="false"
|
||||
android:cropToPadding="false"
|
||||
android:layout_alignRight="@+id/status_avatar"
|
||||
android:visibility="gone"
|
||||
android:paddingRight="@dimen/status_avatar_padding"
|
||||
android:paddingTop="@dimen/status_boost_icon_vertical_padding"
|
||||
android:paddingBottom="@dimen/status_boost_icon_vertical_padding"
|
||||
android:layout_alignParentTop="true" />
|
||||
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/status_avatar"
|
||||
android:layout_alignParentRight="false"
|
||||
android:layout_alignParentTop="false"
|
||||
android:layout_alignParentLeft="false"
|
||||
android:layout_alignParentStart="false"
|
||||
android:layout_below="@+id/status_boosted"
|
||||
android:padding="@dimen/status_avatar_padding" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/status_avatar"
|
||||
android:layout_toEndOf="@+id/status_avatar"
|
||||
android:id="@+id/status_name_bar"
|
||||
android:layout_below="@+id/status_boosted_icon"
|
||||
android:layout_width="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/status_display_name"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
|
||||
android:textStyle="normal|bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/status_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/status_username_left_margin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/status_since_created"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/status_since_created_left_margin" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/status_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/status_avatar"
|
||||
android:layout_toEndOf="@+id/status_avatar"
|
||||
android:layout_below="@+id/status_name_bar" />
|
||||
|
||||
</RelativeLayout>
|
11
app/src/main/res/menu/main_toolbar.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/tools">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_logout"
|
||||
android:title="@string/action_logout"
|
||||
app:showAsAction="never" />
|
||||
|
||||
</menu>
|
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 10 KiB |
6
app/src/main/res/values-w820dp/dimens.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<resources>
|
||||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
|
||||
(such as screen margins) for screens with more than 820dp of available width. This
|
||||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
|
||||
<dimen name="activity_horizontal_margin">0dp</dimen>
|
||||
</resources>
|
7
app/src/main/res/values/colors.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="gray">#4F4F4F</color>
|
||||
</resources>
|
8
app/src/main/res/values/dimens.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<resources>
|
||||
<dimen name="activity_horizontal_margin">0dp</dimen>
|
||||
<dimen name="activity_vertical_margin">0dp</dimen>
|
||||
<dimen name="status_username_left_margin">4dp</dimen>
|
||||
<dimen name="status_since_created_left_margin">4dp</dimen>
|
||||
<dimen name="status_avatar_padding">8dp</dimen>
|
||||
<dimen name="status_boost_icon_vertical_padding">5dp</dimen>
|
||||
</resources>
|
19
app/src/main/res/values/strings.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<resources>
|
||||
<string name="app_name">Tusky</string>
|
||||
|
||||
<string name="oauth_scheme">com.keylesspalace.tusky</string>
|
||||
<string name="oauth_redirect_host">oauth2redirect</string>
|
||||
<string name="preferences_file_key">com.keylesspalace.tusky.PREFERENCES</string>
|
||||
|
||||
<string name="endpoint_authorize">/oauth/authorize</string>
|
||||
<string name="endpoint_token">/oauth/token</string>
|
||||
<string name="endpoint_apps">/api/v1/apps</string>
|
||||
<string name="endpoint_timelines_home">/api/v1/timelines/home</string>
|
||||
|
||||
<string name="error_fetching_timeline">Tusky failed to fetch the timeline.</string>
|
||||
|
||||
<string name="status_username_format">\@%s</string>
|
||||
<string name="status_boosted_format">%s boosted</string>
|
||||
|
||||
<string name="action_logout">Log Out</string>
|
||||
</resources>
|
14
app/src/main/res/values/styles.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowBackground">@drawable/splash_background</item>
|
||||
</style>
|
||||
|
||||
</resources>
|