Skip to content

Commit

Permalink
rename class (#2)
Browse files Browse the repository at this point in the history
* rename

* Update README

* Update README
  • Loading branch information
daisuke-nomura committed Jul 23, 2017
1 parent 3424bc3 commit 70e1a02
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@ Add an annotation to Fragment indicating which FragmentManager to use.
public class MainFragment extends Fragment {

Confirm whether Fragment is added to correct FragmentManger.
Checks with specified id.

//throw IllegalArgumentException due to MainFragment with SupportChildFragmentManager annotation
LookFragmentManager.supportFragmentManager(this, com.kyaracter.fragmentmanagerannotation.example.R.id.fragment);

LookupFragmentManager.supportFragmentManager(this, R.id.fragment);

Or specified tag.

LookupFragmentManager.supportFragmentManager(this, "tag");

Or all Fragments in FragmentManager.

LookupFragmentManager.supportFragmentManager(this);

## Binaries

allprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;

import com.kyaracter.fragmentmanagerannotation.library.LookFragmentManager;
import com.kyaracter.fragmentmanagerannotation.library.LookupFragmentManager;

import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -36,14 +36,14 @@ public void useAppContext() throws Exception {
@Test
public void supportFragmentManagerTest() throws RuntimeException {
MainActivity mainActivity = mActivityRule.launchActivity(null);
LookFragmentManager.supportFragmentManager(mainActivity, com.kyaracter.fragmentmanagerannotation.example.R.id.fragment);
LookupFragmentManager.supportFragmentManager(mainActivity, com.kyaracter.fragmentmanagerannotation.example.R.id.fragment);
onView(withText("Hello World!"));
}

@Test
public void supportChildFragmentManagerTest() throws RuntimeException {
MainActivity mainActivity = mActivityRule.launchActivity(null);
LookFragmentManager.supportFragmentManager(mainActivity, com.kyaracter.fragmentmanagerannotation.example.R.id.fragment);
LookupFragmentManager.supportFragmentManager(mainActivity, com.kyaracter.fragmentmanagerannotation.example.R.id.fragment);
onView(withText("Hello World!"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.kyaracter.fragmentmanagerannotation.library.LookFragmentManager;
import com.kyaracter.fragmentmanagerannotation.library.LookupFragmentManager;


public class MainActivity extends AppCompatActivity {
Expand All @@ -34,6 +34,6 @@ protected void onStart() {
super.onStart();

//throw IllegalArgumentException due to MainFragment with SupportChildFragmentManager annotation
LookFragmentManager.supportFragmentManager(this, com.kyaracter.fragmentmanagerannotation.example.R.id.fragment);
LookupFragmentManager.supportFragmentManager(this, com.kyaracter.fragmentmanagerannotation.example.R.id.fragment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.List;


public class LookFragmentManager {
public class LookupFragmentManager {

public static void frameworkFragmentManager(@NonNull Activity activity, @IdRes int resId) {
Annotation[] annoations = activity.getFragmentManager()
Expand Down

0 comments on commit 70e1a02

Please sign in to comment.