Browse Source

Fixed TopicTitle ellipsizing, removed toolbar from MainActivity, minor tweaks

pull/24/head
Ezerous 8 years ago
parent
commit
ab0b82e04f
  1. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/BookmarkActivity.java
  2. 7
      app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
  3. 5
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
  4. 2
      app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java
  5. 2
      app/src/main/java/gr/thmmy/mthmmy/receiver/Receiver.java
  6. 9
      app/src/main/res/drawable/ic_file_download.xml
  7. 9
      app/src/main/res/layout/activity_main.xml
  8. 7
      app/src/main/res/layout/activity_topic.xml

3
app/src/main/java/gr/thmmy/mthmmy/activities/BookmarkActivity.java

@ -21,6 +21,9 @@ import static gr.thmmy.mthmmy.activities.board.BoardActivity.BUNDLE_BOARD_URL;
import static gr.thmmy.mthmmy.activities.topic.TopicActivity.BUNDLE_TOPIC_TITLE;
import static gr.thmmy.mthmmy.activities.topic.TopicActivity.BUNDLE_TOPIC_URL;
//TODO proper handling with adapter etc.
//TODO better UI
//TODO after clicking bookmark and then back button should return to this activity
public class BookmarkActivity extends BaseActivity {
private TextView boardsTitle;
private TextView topicsTitle;

7
app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java

@ -8,7 +8,6 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.widget.Toast;
import gr.thmmy.mthmmy.R;
@ -57,12 +56,6 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF
overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out);
}
//Initialize toolbar
toolbar = (Toolbar)
findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
//Initialize drawer
createDrawer();

5
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java

@ -14,6 +14,7 @@ import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.method.ScrollingMovementMethod;
import android.text.style.ClickableSpan;
@ -143,7 +144,11 @@ public class TopicActivity extends BaseActivity {
//Initializes graphics
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbarTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
toolbarTitle.setSingleLine(true);
toolbarTitle.setEllipsize(TextUtils.TruncateAt.MARQUEE);
toolbarTitle.setMarqueeRepeatLimit(-1);
toolbarTitle.setText(topicTitle);
toolbarTitle.setSelected(true);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

2
app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java

@ -335,7 +335,9 @@ public abstract class BaseActivity extends AppCompatActivity {
drawer = drawerBuilder.build();
if(!(BaseActivity.this instanceof MainActivity))
drawer.getActionBarDrawerToggle().setDrawerIndicatorEnabled(false);
drawer.setOnDrawerNavigationListener(new Drawer.OnDrawerNavigationListener() {
@Override
public boolean onNavigationClickListener(View clickedView) {

2
app/src/main/java/gr/thmmy/mthmmy/receiver/Receiver.java

@ -49,7 +49,7 @@ public class Receiver extends BroadcastReceiver {
.setContentText(text)
.setTicker(ticker)
.setAutoCancel(true)
.setSmallIcon(R.mipmap.ic_launcher);
.setSmallIcon(R.drawable.ic_file_download);
if (state.equals(STARTED))
builder.setOngoing(true);

9
app/src/main/res/drawable/ic_file_download.xml

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#ffffff"
android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
</vector>

9
app/src/main/res/layout/activity_main.xml

@ -13,17 +13,8 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/appbar_padding_top"
android:theme="@style/ToolbarTheme">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ToolbarTheme">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"

7
app/src/main/res/layout/activity_topic.xml

@ -27,13 +27,6 @@
android:id="@+id/toolbar_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fillViewport="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:maxLines="1"
android:scrollHorizontally="true"
android:textColor="@color/white"
/>
</android.support.v7.widget.Toolbar>

Loading…
Cancel
Save