ActivitySwitcher
ActivitySwitcher ????? Activity ???????????? Activity ????????????? Activity ????????????
?????? Activity ???????????????? CrazyShadow ?????????????
????? ActivitySwitcher ? Issues??????????
Preview
??????????????????????????????????
Sample
Import
?? aslibrary Module ?????, ?????? com.hitomi.aslibrary ???????????????
Usage
1?Application ? ???
ActivitySwitcher.getInstance().init(this);
2?? Activity ??? dispatchTouchEvent ???????????? BaseActivity ????????
@Override public boolean dispatchTouchEvent(MotionEvent ev) {
activitySwitcher.processTouchEvent(ev);
return super.dispatchTouchEvent(ev);
}
?????????? ActivitySwitcher?????????????
activitySwitcher.showSwitcher();
3?Android ??????????? finish ??? Activity?????????????? onBackPressed ???????? BaseActivity ????
@Override public void onBackPressed() {
activitySwitcher.finishSwitch(this);
}
4??????? ActivitySwitcher ????????????????
activitySwitcher.setOnActivitySwitchListener(new ActivitySwitcher.OnActivitySwitchListener() {
@Override
public void onSwitchStarted() {
}
@Override
public void onSwitchFinished(Activity activity) {
}
}
);
onSwitchStarted ?? ActivitySwitcher ??????
onSwitchFinished ? ActivitySwitcher ??????
??????????? MainActivity ??
#Method
?? | ?? |
---|---|
getInstance | ?? ActivitySwitcher ?? (ActivitySwitcher ???) |
init | ????? ActivitySwitcher? ??? Application ? onCreate ????? |
processTouchEvent | ???????? ActivitySwitcher ???? ??? BaseActivity ? dispatchTouchEvent ????? |
showSwitch | ?? ActivitySwitcher???? Activity ??????? |
finishSwitch | ?? ActivitySwitcher? ?? Activity ????????????????? Activity ?? |
exit | ???????? |
setOnActivitySwitchListener | ???????? ActivitySwitcher ?????? |
#Licence
Copyright 2016 Hitomis, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.