|
|
@@ -5,8 +5,11 @@ package kr.co.zumo.app.lifeplus.activity;
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.CallSuper;
|
|
|
+import android.support.design.widget.CoordinatorLayout;
|
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
+import android.support.v7.widget.RecyclerView;
|
|
|
import android.util.Log;
|
|
|
+import android.view.ViewGroup;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
|
|
|
@@ -17,6 +20,7 @@ import kr.co.zumo.app.lifeplus.supervisor.ScreenChangerHelper;
|
|
|
import kr.co.zumo.app.lifeplus.view.fragment.FragmentBase;
|
|
|
import kr.co.zumo.app.lifeplus.view.fragment.factory.BasicFragmentFactory;
|
|
|
import kr.co.zumo.app.lifeplus.view.fragment.factory.FragmentFactory;
|
|
|
+import kr.co.zumo.app.lifeplus.view.fragment.main.MainContentsAdapter;
|
|
|
|
|
|
/**
|
|
|
* MainActivity
|
|
|
@@ -31,6 +35,9 @@ import kr.co.zumo.app.lifeplus.view.fragment.factory.FragmentFactory;
|
|
|
public class MainActivity extends AppCompatActivity {
|
|
|
|
|
|
|
|
|
+ private RecyclerView contentsRecyclerView;
|
|
|
+ private MainContentsAdapter adapter;
|
|
|
+
|
|
|
/***********************************
|
|
|
* Activity
|
|
|
***********************************/
|
|
|
@@ -45,6 +52,8 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
|
DialogHelper.getInstance().setFragmentManager(getSupportFragmentManager());
|
|
|
|
|
|
+ // actionbar
|
|
|
+ setSupportActionBar(findViewById(R.id.toolbar));
|
|
|
ActionBarManager.getInstance().init(this, this.getSupportActionBar());
|
|
|
|
|
|
ScreenChangerHelper.getInstance().setAppCompatActivity(this);
|
|
|
@@ -55,6 +64,12 @@ public class MainActivity extends AppCompatActivity {
|
|
|
ScreenChangerHelper helper = ScreenChangerHelper.getInstance();
|
|
|
ScreenChanger screenChanger = new FragmentChanger(helper.getAppCompatActivity(), helper.getContainerId(), factory);
|
|
|
|
|
|
+ // custom appbar scroll behavior
|
|
|
+ ViewGroup container = findViewById(R.id.container_main);
|
|
|
+ CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) container.getLayoutParams();
|
|
|
+ params.setBehavior(new CustomScrollingViewBehavior());
|
|
|
+ container.setLayoutParams(params);
|
|
|
+
|
|
|
// ScreenStarter 에서 설정된 프래그먼트를 선택한다.
|
|
|
int fragmentFlag = getIntent().getIntExtra(ScreenStarter.FLAG_FRAGMENT, 0);
|
|
|
int screenId = new ScreenIDMapper().getScreenId(fragmentFlag);
|