Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Update Source code #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 15 additions & 28 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
//apply plugin: 'me.tatarka.retrolambda'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdk 32

defaultConfig {
applicationId "io.github.oniatsu.fragmentstack.sample"
minSdkVersion 23
targetSdkVersion 25
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -27,16 +27,14 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled = true
buildFeatures{
viewBinding true
dataBinding true
}
lintOptions {
abortOnError false
checkReleaseBuilds false
}
dexOptions {
maxProcessCount 1
}
}
// apt {
// arguments {
Expand All @@ -45,24 +43,13 @@ android {
// }

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.1.1'

compile 'io.reactivex.rxjava2:rxjava:2.0.5'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.annimon:stream:1.1.5'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

compile 'com.f2prateek.dart:dart:2.0.1'
provided 'com.f2prateek.dart:dart-processor:2.0.1'
compile 'com.f2prateek.dart:henson:2.0.1'
provided 'com.f2prateek.dart:henson-processor:2.0.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

compile project(path: ':fragmentstack')
// compile 'io.github.oniatsu:fragment-pager:0.1.0'
implementation project(path: ':fragmentstack')
}
7 changes: 4 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity android:name="io.github.oniatsu.fragmentstack.sample.views.activities.MainActivity">
android:theme="@style/AppTheme">
<activity
android:name="io.github.oniatsu.fragmentstack.sample.views.activities.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package io.github.oniatsu.fragmentstack.sample.views.activities;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;

import io.github.fragmentstack.FragmentStack;
import io.github.fragmentstack.PageManager;
Expand All @@ -20,7 +20,8 @@ public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
binding = MainActivityBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());

// Set global config (Option)
FragmentStack.globalConfig()
Expand All @@ -42,7 +43,6 @@ protected void onCreate(Bundle savedInstanceState) {
})
.setup();

binding = DataBindingUtil.setContentView(this, R.layout.main_activity);
binding.tabViewPager.setAdapter(new TabFragmentPagerAdapter(this, getSupportFragmentManager()));
binding.tabViewPager.setOffscreenPageLimit(3);
binding.tabLayout.setupWithViewPager(binding.tabViewPager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import io.github.oniatsu.fragmentstack.sample.beans.PageBean;
import io.github.oniatsu.fragmentstack.sample.views.fragments.BaseDefaultFragment;
Expand All @@ -25,7 +26,7 @@ public TabFragmentPagerAdapter(Context context, FragmentManager fragmentManager)
public Fragment getItem(int position) {
Bundle bundle = new Bundle();
PageBean pageBean = new PageBean("Tab " + position, 0);
switch(position){
switch (position) {
case 0:
Default00Fragment default00Fragment = new Default00Fragment();
bundle.putSerializable(BaseDefaultFragment.ExtraKey.pageBean.toString(), pageBean);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.github.oniatsu.fragmentstack.sample.views.fragments;

import android.support.v4.app.FragmentTransaction;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

import androidx.fragment.app.FragmentTransaction;

import io.github.fragmentstack.views.FragmentPagerLifeCycleFragment;
import io.github.oniatsu.fragmentstack.sample.R;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.github.oniatsu.fragmentstack.sample.views.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.github.fragmentstack.FragmentStack;
import io.github.oniatsu.fragmentstack.sample.R;
import io.github.oniatsu.fragmentstack.sample.beans.PageBean;
Expand All @@ -23,14 +25,16 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
}

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FragmentStack.register(this, R.id.default_fragment0_container, new Sub0xFragment());

pageBean = (PageBean) getArguments().getSerializable(ExtraKey.pageBean.toString());
binding.setPageBean(pageBean);
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
binding.setPageBean(pageBean);
binding.componentPage.button1.setOnClickListener(v -> {
Bundle bundle = new Bundle();
Sub0xFragment sub0xFragment = new Sub0xFragment();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.github.oniatsu.fragmentstack.sample.views.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.github.fragmentstack.FragmentStack;
import io.github.oniatsu.fragmentstack.sample.R;
import io.github.oniatsu.fragmentstack.sample.beans.PageBean;
Expand All @@ -23,14 +25,16 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
}

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FragmentStack.register(this, R.id.default_fragment1_container, new Sub1xFragment());

pageBean = (PageBean) getArguments().getSerializable(ExtraKey.pageBean.toString());
binding.setPageBean(pageBean);
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
binding.setPageBean(pageBean);
binding.componentPage.button1.setOnClickListener(v -> {
Bundle bundle = new Bundle();
Sub1xFragment sub1xFragment = new Sub1xFragment();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.github.oniatsu.fragmentstack.sample.views.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.github.fragmentstack.FragmentStack;
import io.github.oniatsu.fragmentstack.sample.R;
import io.github.oniatsu.fragmentstack.sample.beans.PageBean;
Expand All @@ -23,14 +25,16 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
}

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FragmentStack.register(this, R.id.default_fragment2_container, new Sub2xFragment());

pageBean = (PageBean) getArguments().getSerializable(ExtraKey.pageBean.toString());
binding.setPageBean(pageBean);
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
binding.setPageBean(pageBean);
binding.componentPage.button1.setOnClickListener(v -> {
Bundle bundle = new Bundle();
Sub2xFragment sub2xFragment = new Sub2xFragment();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.github.oniatsu.fragmentstack.sample.views.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.github.fragmentstack.FragmentStack;
import io.github.oniatsu.fragmentstack.sample.beans.PageBean;
import io.github.oniatsu.fragmentstack.sample.databinding.SubFragmentBinding;
Expand All @@ -22,12 +24,15 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
}

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
pageBean = (PageBean) getArguments().getSerializable(ExtraKey.pageBean.toString());
binding.setPageBean(pageBean);
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
binding.setPageBean(pageBean);
binding.componentPage.button1.setOnClickListener(v -> {
Bundle bundle = new Bundle();
Sub0xFragment sub0xFragment = new Sub0xFragment();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.github.oniatsu.fragmentstack.sample.views.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.github.fragmentstack.FragmentStack;
import io.github.oniatsu.fragmentstack.sample.beans.PageBean;
import io.github.oniatsu.fragmentstack.sample.databinding.SubFragmentBinding;
Expand All @@ -22,12 +24,15 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
}

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
pageBean = (PageBean) getArguments().getSerializable(ExtraKey.pageBean.toString());
binding.setPageBean(pageBean);
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
binding.setPageBean(pageBean);
binding.componentPage.button1.setOnClickListener(v -> {
Bundle bundle = new Bundle();
Sub1xFragment sub0xFragment = new Sub1xFragment();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.github.oniatsu.fragmentstack.sample.views.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.github.fragmentstack.FragmentStack;
import io.github.oniatsu.fragmentstack.sample.beans.PageBean;
import io.github.oniatsu.fragmentstack.sample.databinding.SubFragmentBinding;
Expand All @@ -22,12 +24,15 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
}

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
pageBean = (PageBean) getArguments().getSerializable(ExtraKey.pageBean.toString());
binding.setPageBean(pageBean);
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
binding.setPageBean(pageBean);
binding.componentPage.button1.setOnClickListener(v -> {
Bundle bundle = new Bundle();
Sub2xFragment sub0xFragment = new Sub2xFragment();
Expand Down
Loading