Skip to content
Snippets Groups Projects
Commit 04d77c1f authored by Jawnnypoo's avatar Jawnnypoo
Browse files

Clean clean clean

parent 2cc9331a
No related branches found
No related tags found
No related merge requests found
Showing
with 51 additions and 34 deletions
Loading
Loading
@@ -11,9 +11,12 @@ import android.support.v7.widget.Toolbar;
import android.view.View;
 
import com.afollestad.appthemeengine.customizers.ATEActivityThemeCustomizer;
import com.commit451.gitlab.LabCoatApp;
import com.commit451.gitlab.R;
import com.commit451.gitlab.api.GitLabClient;
import com.commit451.gitlab.event.CloseDrawerEvent;
import com.commit451.gitlab.fragment.FeedFragment;
import com.squareup.otto.Subscribe;
 
import butterknife.Bind;
import butterknife.ButterKnife;
Loading
Loading
@@ -40,11 +43,17 @@ public class ActivityActivity extends BaseActivity implements ATEActivityThemeCu
@Bind(R.id.drawer_layout) DrawerLayout mDrawerLayout;
@Bind(R.id.toolbar) Toolbar mToolbar;
 
EventReceiver mEventReceiver;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_activity);
ButterKnife.bind(this);
mEventReceiver = new EventReceiver();
LabCoatApp.bus().register(mEventReceiver);
mToolbar.setTitle(R.string.nav_activity);
mToolbar.setNavigationIcon(R.drawable.ic_menu_24dp);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
Loading
Loading
@@ -70,4 +79,18 @@ public class ActivityActivity extends BaseActivity implements ATEActivityThemeCu
.commit();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
LabCoatApp.bus().unregister(mEventReceiver);
}
private class EventReceiver {
@Subscribe
public void onCloseDrawerEvent(CloseDrawerEvent event) {
mDrawerLayout.closeDrawers();
}
}
}
Loading
Loading
@@ -3,14 +3,13 @@ package com.commit451.gitlab.activity;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
 
import com.afollestad.appthemeengine.ATEActivity;
import com.commit451.gitlab.R;
 
/**
* Created by Jawn on 7/27/2015.
* Base activity for others to derive from
*/
public class BaseActivity extends ATEActivity {
 
Loading
Loading
Loading
Loading
@@ -17,14 +17,17 @@ import android.view.View;
import android.widget.TextView;
 
import com.afollestad.appthemeengine.customizers.ATEActivityThemeCustomizer;
import com.commit451.gitlab.LabCoatApp;
import com.commit451.gitlab.R;
import com.commit451.gitlab.adapter.GroupAdapter;
import com.commit451.gitlab.api.EasyCallback;
import com.commit451.gitlab.api.GitLabClient;
import com.commit451.gitlab.event.CloseDrawerEvent;
import com.commit451.gitlab.model.api.Group;
import com.commit451.gitlab.util.NavigationManager;
import com.commit451.gitlab.util.PaginationUtil;
import com.commit451.gitlab.viewHolder.GroupViewHolder;
import com.squareup.otto.Subscribe;
 
import java.util.List;
 
Loading
Loading
@@ -35,7 +38,6 @@ import timber.log.Timber;
 
/**
* Displays the groups of the current user
* Created by Jawn on 10/4/2015.
*/
public class GroupsActivity extends BaseActivity implements ATEActivityThemeCustomizer {
 
Loading
Loading
@@ -60,6 +62,7 @@ public class GroupsActivity extends BaseActivity implements ATEActivityThemeCust
 
private Uri mNextPageUrl;
private boolean mLoading = false;
EventReceiver mEventReceiver;
 
private final RecyclerView.OnScrollListener mOnScrollListener = new RecyclerView.OnScrollListener() {
@Override
Loading
Loading
@@ -127,6 +130,9 @@ public class GroupsActivity extends BaseActivity implements ATEActivityThemeCust
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_groups);
ButterKnife.bind(this);
mEventReceiver = new EventReceiver();
LabCoatApp.bus().register(mEventReceiver);
mToolbar.setTitle(R.string.nav_groups);
mToolbar.setNavigationIcon(R.drawable.ic_menu_24dp);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
Loading
Loading
@@ -155,6 +161,12 @@ public class GroupsActivity extends BaseActivity implements ATEActivityThemeCust
load();
}
 
@Override
protected void onDestroy() {
super.onDestroy();
LabCoatApp.bus().unregister(mEventReceiver);
}
private void load() {
mMessageText.setVisibility(View.GONE);
mSwipeRefreshLayout.post(new Runnable() {
Loading
Loading
@@ -188,7 +200,15 @@ public class GroupsActivity extends BaseActivity implements ATEActivityThemeCust
 
mLoading = true;
 
Timber.d("loadMore called for " + mNextPageUrl);
Timber.d("loadMore called for %s", mNextPageUrl);
GitLabClient.instance().getGroups(mNextPageUrl.toString()).enqueue(mMoreGroupsCallback);
}
private class EventReceiver {
@Subscribe
public void onCloseDrawerEvent(CloseDrawerEvent event) {
mDrawerLayout.closeDrawers();
}
}
}
Loading
Loading
@@ -26,7 +26,6 @@ import butterknife.ButterKnife;
 
/**
* Shows the projects
* Created by Jawn on 9/21/2015.
*/
public class ProjectsActivity extends BaseActivity implements ATEActivityThemeCustomizer {
 
Loading
Loading
Loading
Loading
@@ -12,7 +12,6 @@ import timber.log.Timber;
 
/**
* Adds the private token to all requests
* Created by Jawn on 9/15/2015.
*/
public class AuthenticationRequestInterceptor implements Interceptor {
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,6 @@ package com.commit451.gitlab.event;
 
/**
* Close the drawer!
* Created by Jawn on 7/28/2015.
*/
public class CloseDrawerEvent {
}
Loading
Loading
@@ -4,7 +4,6 @@ import com.commit451.gitlab.model.api.Issue;
 
/**
* Event indicating that an issue has changed
* Created by Jawnnypoo on 10/19/2015.
*/
public class IssueChangedEvent {
public final Issue mIssue;
Loading
Loading
Loading
Loading
@@ -4,7 +4,6 @@ import com.commit451.gitlab.model.api.Issue;
 
/**
* Oh no! An Issue!
* Created by Jawn on 7/31/2015.
*/
public class IssueCreatedEvent {
public final Issue mIssue;
Loading
Loading
Loading
Loading
@@ -4,7 +4,6 @@ import com.commit451.gitlab.model.Account;
 
/**
* Called when a user logs in
* Created by John on 12/23/15.
*/
public class LoginEvent {
public Account account;
Loading
Loading
package com.commit451.gitlab.event;
/**
* Created by Jawn on 8/21/2015.
*/
public class LogoutEvent {
}
Loading
Loading
@@ -4,7 +4,6 @@ import com.commit451.gitlab.model.api.Member;
 
/**
* Indicates that a user was added
* Created by Jawn on 9/17/2015.
*/
public class MemberAddedEvent {
public final Member mMember;
Loading
Loading
Loading
Loading
@@ -4,7 +4,6 @@ import com.commit451.gitlab.model.api.Project;
 
/**
* Signifies that either a project or its branch has changed and there needs to be a reload
* Created by Jawn on 9/22/2015.
*/
public class ProjectReloadEvent {
public final Project mProject;
Loading
Loading
Loading
Loading
@@ -2,7 +2,6 @@ package com.commit451.gitlab.event;
 
/**
* Signifies that the fragments should reload their data
* Created by Jawn on 9/1/2015.
*/
public class ReloadDataEvent {
}
Loading
Loading
@@ -12,7 +12,6 @@ import okhttp3.logging.HttpLoggingInterceptor;
 
/**
* Creates an OkHttpClient with the needed defaults
* Created by Jawn on 12/4/2015.
*/
public final class OkHttpClientProvider {
private static Account sAccount;
Loading
Loading
Loading
Loading
@@ -7,7 +7,6 @@ import com.commit451.gitlab.model.api.UserFull;
 
/**
* Utility for doing various image related things
* Created by Jawn on 9/20/2015.
*/
public class ImageUtil {
public static Uri getAvatarUrl(UserBasic user, int size) {
Loading
Loading
Loading
Loading
@@ -13,7 +13,6 @@ import com.novoda.simplechromecustomtabs.SimpleChromeCustomTabs;
 
/**
* All the things to do with intents
* Created by Jawn on 8/25/2015.
*/
public class IntentUtil {
 
Loading
Loading
Loading
Loading
@@ -8,10 +8,6 @@ import com.novoda.simplechromecustomtabs.navigation.SimpleChromeCustomTabsIntent
 
/**
* Customize custom intents
* <br>
* Copyright 2016 <a href="http://www.ovenbits.com">Oven Bits</a>
*
* @author Jawn.
*/
public class LabCoatIntentCustomizer implements IntentCustomizer {
 
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@ import android.webkit.WebSettings;
import android.webkit.WebView;
 
/**
* Created by Jawn on 8/25/2015.
* WebView with nice defaults
*/
public class BetterWebView extends WebView {
 
Loading
Loading
Loading
Loading
@@ -18,7 +18,6 @@ import java.util.Set;
 
/**
* Automagically fills in email accounts
* Created by John on 8/13/15.
*/
public class EmailAutoCompleteTextView extends AppCompatAutoCompleteTextView {
 
Loading
Loading
Loading
Loading
@@ -5,22 +5,21 @@ import android.graphics.Rect;
import android.os.Build;
import android.support.v7.widget.CardView;
import android.util.AttributeSet;
import android.widget.LinearLayout;
 
public class GitLabCardView extends CardView {
public class LabCoatCardView extends CardView {
 
private boolean mAreMarginsAdjusted = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
private Rect mShadowPadding;
 
public GitLabCardView(Context context) {
public LabCoatCardView(Context context) {
super(context);
}
 
public GitLabCardView(Context context, AttributeSet attrs) {
public LabCoatCardView(Context context, AttributeSet attrs) {
super(context, attrs);
}
 
public GitLabCardView(Context context, AttributeSet attrs, int defStyleAttr) {
public LabCoatCardView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment