Browse Source

Added drawer intro, tiny changes

pull/49/head
Ezerous 6 years ago
parent
commit
5489102ef4
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 12
      CONTRIBUTING.md
  2. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
  3. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
  4. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java
  5. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/ReplyTask.java
  6. 2
      app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java
  7. 1
      app/src/main/java/gr/thmmy/mthmmy/editorview/AutoFitGridLayout.java

12
CONTRIBUTING.md

@ -7,7 +7,7 @@ to contribute to mTHMMY in a way that is efficient for everyone.
**Important!** Instead of creating publicly viewable issues for suspected security
vulnerabilities, please report them in private to
`thmmynolife@gmail.com`.
[thmmynolife@gmail.com](mailto:thmmynolife@gmail.com).
## I want to contribute!
@ -18,7 +18,7 @@ There are many ways of contributing to mTHMMY:
- Submitting bugs and ideas to our [issue tracker][github-issues]
- Forking mTHMMY and submitting [pull requests](#pull-requests)
- Joining our core team
- Contacting us by email at `thmmynolife@gmail.com`
- Contacting us by email at [thmmynolife@gmail.com](mailto:thmmynolife@gmail.com)
## Issue tracker
@ -27,17 +27,17 @@ Before creating a new issue make sure to **search the tracker** for similar ones
## Compiling
Due to the app's integration with Firebase, a `google-services.json` is required inside the `app` directory. To get one, either [set up your own Firebase project][firebase-console] (with or without a self hosted [backend][sisyphus]), or ask us to provide you the one we use for development.
Due to the app's integration with Firebase, a *google-services.json* file is required inside the *app* directory. To get one, either [set up your own Firebase project][firebase-console] (with or without a self hosted [backend][sisyphus]), or ask us to provide you the one we use for development.
## Pull requests
Pull requests with fixes and improvements to mTHMMY are most welcome. Any developer that wants to work independently from the core team can simply
follow the workflow below to make a pull request:
follow the workflow below to make a pull request (PR):
1. Fork the project into your personal space on Github
1. Create a feature branch, away from `develop`
1. Create a feature branch, away from [develop](https://github.com/ThmmyNoLife/mTHMMY/tree/develop)
1. Push the commit(s) to your fork
1. Create a pull request (PR) targeting `develop` [at mTHMMY](https://github.com/ThmmyNoLife/mTHMMY/tree/develop)
1. Create a PR targeting [develop at mTHMMY](https://github.com/ThmmyNoLife/mTHMMY/tree/develop)
1. Fill the PR title describing the change you want to make
1. Fill the PR description with a brief motive for your change and the method you used to achieve it
1. Submit the PR.

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

@ -45,6 +45,8 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF
//-----------------------------------------CLASS VARIABLES------------------------------------------
private static final int TIME_INTERVAL = 2000;
private SharedPreferences sharedPrefs;
private static final String DRAWER_INTRO = "DRAWER_INTRO";
private long mBackPressed;
private SectionsPagerAdapter sectionsPagerAdapter;
private ViewPager viewPager;
@ -83,13 +85,12 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF
TabLayout tabLayout = findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
int preferredTab = Integer.parseInt(sharedPrefs.getString(DEFAULT_HOME_TAB, "0"));
if (preferredTab != 3 || sessionManager.isLoggedIn()) {
tabLayout.getTabAt(preferredTab).select();
}
setMainActivity(this);
}
@ -103,6 +104,10 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF
@Override
protected void onResume() {
drawer.setSelection(HOME_ID);
if(!sharedPrefs.getBoolean(DRAWER_INTRO, false)){
drawer.openDrawer();
sharedPrefs.edit().putBoolean(DRAWER_INTRO, true).apply();
}
updateTabs();
super.onResume();
}

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

@ -41,11 +41,11 @@ import gr.thmmy.mthmmy.activities.topic.tasks.PrepareForReply;
import gr.thmmy.mthmmy.activities.topic.tasks.ReplyTask;
import gr.thmmy.mthmmy.activities.topic.tasks.TopicTask;
import gr.thmmy.mthmmy.base.BaseActivity;
import gr.thmmy.mthmmy.editorview.EmojiKeyboard;
import gr.thmmy.mthmmy.model.Bookmark;
import gr.thmmy.mthmmy.model.Post;
import gr.thmmy.mthmmy.model.ThmmyPage;
import gr.thmmy.mthmmy.utils.CustomLinearLayoutManager;
import gr.thmmy.mthmmy.editorview.EmojiKeyboard;
import gr.thmmy.mthmmy.utils.HTMLUtils;
import gr.thmmy.mthmmy.utils.parsing.ParseHelpers;
import gr.thmmy.mthmmy.viewmodel.TopicViewModel;

4
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

@ -42,12 +42,12 @@ import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.board.BoardActivity;
import gr.thmmy.mthmmy.activities.profile.ProfileActivity;
import gr.thmmy.mthmmy.base.BaseActivity;
import gr.thmmy.mthmmy.editorview.EditorView;
import gr.thmmy.mthmmy.editorview.EmojiKeyboard;
import gr.thmmy.mthmmy.model.Post;
import gr.thmmy.mthmmy.model.ThmmyFile;
import gr.thmmy.mthmmy.model.ThmmyPage;
import gr.thmmy.mthmmy.utils.CircleTransform;
import gr.thmmy.mthmmy.editorview.EditorView;
import gr.thmmy.mthmmy.editorview.EmojiKeyboard;
import gr.thmmy.mthmmy.utils.parsing.ParseHelpers;
import gr.thmmy.mthmmy.viewmodel.TopicViewModel;
import timber.log.Timber;

2
app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/ReplyTask.java

@ -31,7 +31,7 @@ public class ReplyTask extends AsyncTask<String, Void, Boolean> {
@Override
protected Boolean doInBackground(String... args) {
final String sentFrommTHMMY = includeAppSignature
? "\n[right][size=7pt][i]sent from [url=https://play.google.com/store/apps/details?id=gr.thmmy.mthmmy]mTHMMY [/url][/i][/size][/right]"
? "\n[right][size=7pt][i]sent from [url=https://play.google.com/store/apps/details?id=gr.thmmy.mthmmy]mTHMMY[/url][/i] [/size][/right]"
: "";
RequestBody postBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)

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

@ -42,7 +42,7 @@ import timber.log.Timber;
public class BaseApplication extends Application {
private static BaseApplication baseApplication; //BaseApplication singleton
//FirebaseAnalytics
//Firebase Analytics
private FirebaseAnalytics firebaseAnalytics;
//Client & SessionManager

1
app/src/main/java/gr/thmmy/mthmmy/editorview/AutoFitGridLayout.java

@ -4,6 +4,7 @@ import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.GridLayout;
import gr.thmmy.mthmmy.R;
public class AutoFitGridLayout extends GridLayout {

Loading…
Cancel
Save