Browse Source

Package changes, added drawer to more activities

pull/24/head
Ezerous 8 years ago
parent
commit
8e007dc910
  1. 11
      app/src/main/AndroidManifest.xml
  2. 15
      app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
  3. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
  4. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/TopicActivity.java
  5. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
  6. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumAdapter.java
  7. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
  8. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
  9. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java
  10. 29
      app/src/main/res/layout/activity_about.xml
  11. 2
      app/src/main/res/layout/activity_main.xml
  12. 2
      app/src/main/res/layout/activity_topic.xml
  13. 2
      app/src/main/res/layout/fragment_recent.xml

11
app/src/main/AndroidManifest.xml

@ -14,7 +14,7 @@
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity <activity
android:name=".activities.MainActivity" android:name=".activities.main.MainActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTop" android:launchMode="singleTop"
@ -32,19 +32,20 @@
</activity> </activity>
<activity <activity
android:name=".activities.AboutActivity" android:name=".activities.AboutActivity"
android:parentActivityName=".activities.MainActivity"> android:parentActivityName=".activities.main.MainActivity"
android:theme="@style/AppTheme.NoActionBar">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity"/> android:value=".activities.main.MainActivity"/>
</activity> </activity>
<activity <activity
android:name=".activities.TopicActivity" android:name=".activities.TopicActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:parentActivityName=".activities.MainActivity" android:parentActivityName=".activities.main.MainActivity"
android:theme="@style/AppTheme.NoActionBar"> android:theme="@style/AppTheme.NoActionBar">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity"/> android:value=".activities.main.MainActivity"/>
</activity> </activity>
<activity android:name=".activities.BaseActivity"/> <activity android:name=".activities.BaseActivity"/>
</application> </application>

15
app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java

@ -1,18 +1,31 @@
package gr.thmmy.mthmmy.activities; package gr.thmmy.mthmmy.activities;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.TextView; import android.widget.TextView;
import gr.thmmy.mthmmy.BuildConfig; import gr.thmmy.mthmmy.BuildConfig;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
public class AboutActivity extends BaseActivity { public class AboutActivity extends BaseActivity
{
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about); setContentView(R.layout.activity_about);
String versionName = BuildConfig.VERSION_NAME; String versionName = BuildConfig.VERSION_NAME;
//Initialize toolbar
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(R.string.about);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
createDrawer();
TextView tv = (TextView) findViewById(R.id.version); TextView tv = (TextView) findViewById(R.id.version);
if (tv != null) if (tv != null)
tv.setText(getString(R.string.version, versionName)); tv.setText(getString(R.string.version, versionName));

1
app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java

@ -11,6 +11,7 @@ import android.widget.EditText;
import android.widget.Toast; import android.widget.Toast;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.main.MainActivity;
import static gr.thmmy.mthmmy.session.SessionManager.CONNECTION_ERROR; import static gr.thmmy.mthmmy.session.SessionManager.CONNECTION_ERROR;
import static gr.thmmy.mthmmy.session.SessionManager.EXCEPTION; import static gr.thmmy.mthmmy.session.SessionManager.EXCEPTION;

2
app/src/main/java/gr/thmmy/mthmmy/activities/TopicActivity.java

@ -109,6 +109,8 @@ public class TopicActivity extends BaseActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true);
createDrawer();
//Variables initialization //Variables initialization
postsLinearLayout = (LinearLayout) findViewById(R.id.posts_list); postsLinearLayout = (LinearLayout) findViewById(R.id.posts_list);

9
app/src/main/java/gr/thmmy/mthmmy/activities/MainActivity.java → app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java

@ -1,4 +1,4 @@
package gr.thmmy.mthmmy.activities; package gr.thmmy.mthmmy.activities.main;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
@ -10,9 +10,12 @@ import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.activities.LoginActivity;
import gr.thmmy.mthmmy.activities.TopicActivity;
import gr.thmmy.mthmmy.data.TopicSummary; import gr.thmmy.mthmmy.data.TopicSummary;
import gr.thmmy.mthmmy.sections.forum.ForumFragment; import gr.thmmy.mthmmy.activities.main.forum.ForumFragment;
import gr.thmmy.mthmmy.sections.recent.RecentFragment; import gr.thmmy.mthmmy.activities.main.recent.RecentFragment;
import static gr.thmmy.mthmmy.session.SessionManager.LOGGED_OUT; import static gr.thmmy.mthmmy.session.SessionManager.LOGGED_OUT;

4
app/src/main/java/gr/thmmy/mthmmy/sections/forum/ForumAdapter.java → app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumAdapter.java

@ -1,4 +1,4 @@
package gr.thmmy.mthmmy.sections.forum; package gr.thmmy.mthmmy.activities.main.forum;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -10,7 +10,7 @@ import java.util.List;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.data.TopicSummary; import gr.thmmy.mthmmy.data.TopicSummary;
import gr.thmmy.mthmmy.sections.recent.RecentFragment; import gr.thmmy.mthmmy.activities.main.recent.RecentFragment;
/** /**

2
app/src/main/java/gr/thmmy/mthmmy/sections/forum/ForumFragment.java → app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java

@ -1,4 +1,4 @@
package gr.thmmy.mthmmy.sections.forum; package gr.thmmy.mthmmy.activities.main.forum;
import android.content.Context; import android.content.Context;
import android.os.AsyncTask; import android.os.AsyncTask;

2
app/src/main/java/gr/thmmy/mthmmy/sections/recent/RecentAdapter.java → app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java

@ -1,4 +1,4 @@
package gr.thmmy.mthmmy.sections.recent; package gr.thmmy.mthmmy.activities.main.recent;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;

2
app/src/main/java/gr/thmmy/mthmmy/sections/recent/RecentFragment.java → app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java

@ -1,4 +1,4 @@
package gr.thmmy.mthmmy.sections.recent; package gr.thmmy.mthmmy.activities.main.recent;
import android.content.Context; import android.content.Context;
import android.os.AsyncTask; import android.os.AsyncTask;

29
app/src/main/res/layout/activity_about.xml

@ -1,5 +1,31 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.AppBarLayout
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/popupTheme">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<ScrollView android:layout_marginTop="64dp"
android:id="@+id/scrollview" android:id="@+id/scrollview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -44,3 +70,4 @@
android:src="@mipmap/ic_launcher"/> android:src="@mipmap/ic_launcher"/>
</RelativeLayout> </RelativeLayout>
</ScrollView> </ScrollView>
</LinearLayout>

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

@ -7,7 +7,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
tools:context=".activities.MainActivity"> tools:context=".activities.main.MainActivity">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:id="@+id/appbar" android:id="@+id/appbar"

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

@ -7,7 +7,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
tools:context=".activities.MainActivity"> tools:context=".activities.main.MainActivity">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:id="@+id/appbar" android:id="@+id/appbar"

2
app/src/main/res/layout/fragment_recent.xml

@ -22,7 +22,7 @@
android:paddingBottom="4dp" android:paddingBottom="4dp"
android:paddingTop="4dp" android:paddingTop="4dp"
app:layoutManager="LinearLayoutManager" app:layoutManager="LinearLayoutManager"
tools:context="gr.thmmy.mthmmy.sections.recent.RecentFragment" tools:context=".activities.main.recent.RecentFragment"
tools:listitem="@layout/fragment_recent_row"/> tools:listitem="@layout/fragment_recent_row"/>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>

Loading…
Cancel
Save