diff --git a/app/build.gradle b/app/build.gradle
index ec1a6174..6de288cc 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -30,5 +30,7 @@ dependencies {
compile 'com.android.support:support-v13:25.1.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:design:25.1.0'
+ compile 'com.squareup.picasso:picasso:2.5.2'
+ compile 'com.pkmmte.view:circularimageview:1.1'
testCompile 'junit:junit:4.12'
}
diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
index dcb1f81a..313086b3 100644
--- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
@@ -19,9 +19,13 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
+import android.icu.text.NumberFormat;
+import android.media.Image;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
+import android.support.design.widget.CollapsingToolbarLayout;
+import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
@@ -31,6 +35,7 @@ import android.text.method.LinkMovementMethod;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
+import android.widget.ImageView;
import android.widget.TextView;
import com.android.volley.AuthFailureError;
@@ -41,6 +46,8 @@ import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.NetworkImageView;
+import com.pkmmte.view.CircularImageView;
+import com.squareup.picasso.Picasso;
import org.json.JSONArray;
import org.json.JSONException;
@@ -78,11 +85,21 @@ public class AccountActivity extends BaseActivity {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
- NetworkImageView avatar = (NetworkImageView) findViewById(R.id.account_avatar);
- NetworkImageView header = (NetworkImageView) findViewById(R.id.account_header);
- avatar.setDefaultImageResId(R.drawable.avatar_default);
- avatar.setErrorImageResId(R.drawable.avatar_error);
- header.setDefaultImageResId(R.drawable.account_header_default);
+ ActionBar actionBar = getSupportActionBar();
+
+ if (actionBar != null) {
+ actionBar.setTitle(null);
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ actionBar.setDisplayShowHomeEnabled(true);
+ }
+
+ FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn);
+ floatingBtn.hide();
+
+ CircularImageView avatar = (CircularImageView) findViewById(R.id.account_avatar);
+ ImageView header = (ImageView) findViewById(R.id.account_header);
+ avatar.setImageResource(R.drawable.avatar_default);
+ header.setImageResource(R.drawable.account_header_default);
obtainAccount();
if (!accountId.equals(loggedInAccountId)) {
@@ -165,39 +182,43 @@ public class AccountActivity extends BaseActivity {
TextView username = (TextView) findViewById(R.id.account_username);
TextView displayName = (TextView) findViewById(R.id.account_display_name);
TextView note = (TextView) findViewById(R.id.account_note);
- NetworkImageView avatar = (NetworkImageView) findViewById(R.id.account_avatar);
- NetworkImageView header = (NetworkImageView) findViewById(R.id.account_header);
+ CircularImageView avatar = (CircularImageView) findViewById(R.id.account_avatar);
+ ImageView header = (ImageView) findViewById(R.id.account_header);
String usernameFormatted = String.format(
getString(R.string.status_username_format), account.username);
username.setText(usernameFormatted);
displayName.setText(account.displayName);
- ActionBar actionBar = getSupportActionBar();
- if (actionBar != null) {
- actionBar.setTitle(account.displayName);
- }
note.setText(account.note);
note.setLinksClickable(true);
note.setMovementMethod(LinkMovementMethod.getInstance());
- ImageLoader imageLoader = VolleySingleton.getInstance(this).getImageLoader();
if (!account.avatar.isEmpty()) {
- avatar.setImageUrl(account.avatar, imageLoader);
+ Picasso.with(this)
+ .load(account.avatar)
+ .placeholder(R.drawable.avatar_default)
+ .error(R.drawable.avatar_error)
+ .into(avatar);
}
if (!account.header.isEmpty()) {
- header.setImageUrl(account.header, imageLoader);
+ Picasso.with(this)
+ .load(account.header)
+ .placeholder(R.drawable.account_header_default)
+ .into(header);
}
openInWebUrl = account.url;
+ java.text.NumberFormat nf = java.text.NumberFormat.getInstance();
// Add counts to the tabs in the TabLayout.
String[] counts = {
- account.statusesCount,
- account.followingCount,
- account.followersCount,
+ nf.format(Integer.parseInt(account.statusesCount)),
+ nf.format(Integer.parseInt(account.followingCount)),
+ nf.format(Integer.parseInt(account.followersCount)),
};
+
for (int i = 0; i < tabLayout.getTabCount(); i++) {
TabLayout.Tab tab = tabLayout.getTabAt(i);
if (tab != null) {
@@ -261,9 +282,29 @@ public class AccountActivity extends BaseActivity {
private void onObtainRelationshipsSuccess(boolean following, boolean blocking) {
this.following = following;
this.blocking = blocking;
+
if (!following || !blocking) {
invalidateOptionsMenu();
}
+
+ updateButtons();
+ }
+
+ private void updateButtons() {
+ invalidateOptionsMenu();
+
+ FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn);
+
+ if(!isSelf && !blocking && !following) {
+ floatingBtn.show();
+ floatingBtn.setImageResource(R.drawable.ic_person_add_24dp);
+ floatingBtn.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ follow(accountId);
+ }
+ });
+ }
}
private void onObtainRelationshipsFailure(Exception exception) {
@@ -337,7 +378,7 @@ public class AccountActivity extends BaseActivity {
return;
}
following = followingValue;
- invalidateOptionsMenu();
+ updateButtons();
}
},
new Response.ErrorListener() {
@@ -385,7 +426,7 @@ public class AccountActivity extends BaseActivity {
return;
}
blocking = blockingValue;
- invalidateOptionsMenu();
+ updateButtons();
}
},
new Response.ErrorListener() {
@@ -417,10 +458,8 @@ public class AccountActivity extends BaseActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case R.id.action_back: {
- Intent intent = new Intent(this, MainActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
+ case android.R.id.home: {
+ onBackPressed();
return true;
}
case R.id.action_open_in_web: {
diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java
index 50c0463a..899bd1a3 100644
--- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java
@@ -23,12 +23,14 @@ import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.SystemClock;
import android.preference.PreferenceManager;
+import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.View;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
@@ -62,6 +64,15 @@ public class MainActivity extends BaseActivity {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
+ FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn);
+ floatingBtn.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(getApplicationContext(), ComposeActivity.class);
+ startActivity(intent);
+ }
+ });
+
// Setup the tabs and timeline pager.
TimelinePagerAdapter adapter = new TimelinePagerAdapter(getSupportFragmentManager());
String[] pageTitles = {
@@ -170,11 +181,6 @@ public class MainActivity extends BaseActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case R.id.action_compose: {
- Intent intent = new Intent(this, ComposeActivity.class);
- startActivity(intent);
- return true;
- }
case R.id.action_view_profile: {
Intent intent = new Intent(this, AccountActivity.class);
intent.putExtra("id", loggedInAccountId);
diff --git a/app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java
index bc5d91f7..5be5cf2a 100644
--- a/app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java
+++ b/app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java
@@ -26,11 +26,13 @@ import android.text.style.URLSpan;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ImageButton;
+import android.widget.ImageView;
import android.widget.TextView;
import android.widget.ToggleButton;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.NetworkImageView;
+import com.squareup.picasso.Picasso;
import java.util.Date;
@@ -40,7 +42,7 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
private TextView username;
private TextView sinceCreated;
private TextView content;
- private NetworkImageView avatar;
+ private ImageView avatar;
private View rebloggedBar;
private TextView rebloggedByDisplayName;
private ImageButton replyButton;
@@ -65,9 +67,7 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
username = (TextView) itemView.findViewById(R.id.status_username);
sinceCreated = (TextView) itemView.findViewById(R.id.status_since_created);
content = (TextView) itemView.findViewById(R.id.status_content);
- avatar = (NetworkImageView) itemView.findViewById(R.id.status_avatar);
- avatar.setDefaultImageResId(R.drawable.avatar_default);
- avatar.setErrorImageResId(R.drawable.avatar_error);
+ avatar = (ImageView) itemView.findViewById(R.id.status_avatar);
rebloggedBar = itemView.findViewById(R.id.status_reblogged_bar);
rebloggedByDisplayName = (TextView) itemView.findViewById(R.id.status_reblogged);
replyButton = (ImageButton) itemView.findViewById(R.id.status_reply);
@@ -159,8 +159,11 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
return;
}
Context context = avatar.getContext();
- ImageLoader imageLoader = VolleySingleton.getInstance(context).getImageLoader();
- avatar.setImageUrl(url, imageLoader);
+ Picasso.with(context)
+ .load(url)
+ .placeholder(R.drawable.avatar_default)
+ .error(R.drawable.avatar_error)
+ .into(avatar);
}
private void setCreatedAt(@Nullable Date createdAt) {
@@ -202,10 +205,10 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
private void setRebloggingEnabled(boolean enabled) {
reblogButton.setEnabled(enabled);
if (enabled) {
- reblogButton.setImageResource(R.drawable.ic_reblog);
+ reblogButton.setImageResource(R.drawable.ic_repeat_24dp);
} else {
ThemeUtils.setImageViewTint(reblogButton, R.attr.status_reblog_button_disabled_tint);
- reblogButton.setImageResource(R.drawable.ic_reblog_disabled);
+ reblogButton.setImageResource(R.drawable.ic_lock_24dp);
}
}
diff --git a/app/src/main/res/drawable/account_header_gradient.xml b/app/src/main/res/drawable/account_header_gradient.xml
new file mode 100644
index 00000000..f1ae0bab
--- /dev/null
+++ b/app/src/main/res/drawable/account_header_gradient.xml
@@ -0,0 +1,12 @@
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_create_24dp.xml b/app/src/main/res/drawable/ic_create_24dp.xml
new file mode 100644
index 00000000..fb323492
--- /dev/null
+++ b/app/src/main/res/drawable/ic_create_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_lock_24dp.xml b/app/src/main/res/drawable/ic_lock_24dp.xml
new file mode 100644
index 00000000..6316164d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_lock_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_more_horiz_24dp.xml b/app/src/main/res/drawable/ic_more_horiz_24dp.xml
new file mode 100644
index 00000000..cba1e880
--- /dev/null
+++ b/app/src/main/res/drawable/ic_more_horiz_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_person_add_24dp.xml b/app/src/main/res/drawable/ic_person_add_24dp.xml
new file mode 100644
index 00000000..5c029e12
--- /dev/null
+++ b/app/src/main/res/drawable/ic_person_add_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_person_outline_24dp.xml b/app/src/main/res/drawable/ic_person_outline_24dp.xml
new file mode 100644
index 00000000..4ad4f8d0
--- /dev/null
+++ b/app/src/main/res/drawable/ic_person_outline_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_repeat_24dp.xml b/app/src/main/res/drawable/ic_repeat_24dp.xml
new file mode 100644
index 00000000..4b13abca
--- /dev/null
+++ b/app/src/main/res/drawable/ic_repeat_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_reply_24dp.xml b/app/src/main/res/drawable/ic_reply_24dp.xml
new file mode 100644
index 00000000..5fcea57d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_reply_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_star_24dp.xml b/app/src/main/res/drawable/ic_star_24dp.xml
new file mode 100644
index 00000000..47ad2489
--- /dev/null
+++ b/app/src/main/res/drawable/ic_star_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/toggle_small.xml b/app/src/main/res/drawable/toggle_small.xml
index 03947856..b6b80bfc 100644
--- a/app/src/main/res/drawable/toggle_small.xml
+++ b/app/src/main/res/drawable/toggle_small.xml
@@ -1,6 +1,6 @@
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml
index e99535c8..3ffb121d 100644
--- a/app/src/main/res/layout/activity_account.xml
+++ b/app/src/main/res/layout/activity_account.xml
@@ -10,77 +10,97 @@
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+ android:id="@+id/account_note"
+ android:textColor="?android:textColorTertiary"
+ android:padding="16dp"
+ android:paddingTop="10dp"/>
+
+
@@ -95,6 +115,7 @@
@@ -119,4 +140,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 2da08be8..031b9ccf 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,5 +1,5 @@
-
@@ -54,14 +55,19 @@
-
-
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_status.xml b/app/src/main/res/layout/item_status.xml
index 853296e5..e4fd8edb 100644
--- a/app/src/main/res/layout/item_status.xml
+++ b/app/src/main/res/layout/item_status.xml
@@ -3,6 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
android:id="@+id/status_container">
+ android:paddingRight="10dp"
+ android:paddingLeft="24dp"
+ android:tint="?android:textColorTertiary" />
-
+ android:layout_marginTop="10dp"
+ android:layout_marginRight="10dp" />
-
-
+
+
-
+
+
+ android:layout_alignParentRight="true"
+ android:text="20m ago"
+ android:textColor="?android:textColorSecondary" />
-
+
+ android:layout_marginBottom="4dp">
+ android:padding="3dp"
+ android:textSize="12sp"
+ android:background="?attr/content_warning_button" />
@@ -104,6 +125,7 @@
android:id="@+id/status_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:textColor="?android:textColorPrimary"
android:layout_toRightOf="@+id/status_avatar"
android:layout_toEndOf="@+id/status_avatar"
android:layout_below="@+id/status_content_warning_bar" />
@@ -195,10 +217,10 @@
android:layout_below="@id/status_media_preview_container"
android:layout_toRightOf="@+id/status_avatar"
android:paddingBottom="8dp"
- android:paddingTop="8dp">
+ android:paddingTop="10dp">
-
-
diff --git a/app/src/main/res/menu/main_toolbar.xml b/app/src/main/res/menu/main_toolbar.xml
index 8ed161a5..2517ee5d 100644
--- a/app/src/main/res/menu/main_toolbar.xml
+++ b/app/src/main/res/menu/main_toolbar.xml
@@ -3,12 +3,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
-
-
- #4F4F4F
#000000
- #44A673
- #2C996E
- #3F8A65
- #3F8A65
- #3C4945
- #191E1E
+ #4c5368
+ #363c4b
+ #2b90d9
+ #2b90d9
+ #1a1c23
+ #282c37
#FFFFFF
#FFFFFF
- #FFFFFF
- #FFFFFF
+ #d9e1e8
+ #9baec8
#000000
#000000
#000000
- #44A673
- #FFFFFF
- #CFCFCF
- #CFCFCF
- #00DFAF
- #6F6F6F
- #CFCFCF
- #DFCF00
+ #4c5368
+ #d9e1e8
+ #68738f
+ #68738f
+ #2b90d9
+ #363c4b
+ #68738f
+ #ca8f04
#303030
#2F2F2F
#A4B4BC
- #000000
+ #2f3441
#4C534B
#000000
#FFFFFF
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 97409792..249a40ae 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -16,7 +16,7 @@
- @color/color_accent_dark
- @color/button_dark
- - @color/color_background_dark
+ - @color/color_primary_dark_dark
- @color/window_background_dark
- @color/edit_text_color_dark
- @color/text_color_primary_dark
@@ -38,7 +38,6 @@
- @color/status_favourite_button_marked_dark
- @drawable/toggle_small
- @color/sensitive_media_warning_background_dark
- - @color/status_text_secondary_dark
- @drawable/media_preview_unloaded_dark
- @drawable/status_divider_dark
- @drawable/tab_page_margin_dark
diff --git a/build.gradle b/build.gradle
index 74b2ab0d..1ea4bd05 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.2.3'
+ classpath 'com.android.tools.build:gradle:2.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 04e285f3..19330f4d 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Dec 28 10:00:20 PST 2015
+#Mon Mar 06 17:29:49 CET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip