Skip to content

Commit

Permalink
refactor(multi-sub-panels): add the new method in KPSwitchConflictUti…
Browse files Browse the repository at this point in the history
…l to prompt, it unnecessary must provide the switch-click-listener if you don't care about panel-switch in attach(panelLayout,focusView,subPanelAndTriggers...)
  • Loading branch information
Jacksgong committed Aug 11, 2016
1 parent 85fa84b commit c2f05a4
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ public boolean onTouch(View v, MotionEvent event) {
}
}

/**
* The same to {@link #attach(View, View, SwitchClickListener, SubPanelAndTrigger...)}.
*/
public static void attach(final View panelLayout,
final View focusView,
SubPanelAndTrigger... subPanelAndTriggers) {
attach(panelLayout, focusView, null, subPanelAndTriggers);
}

/**
* If you have multiple sub-panels in the {@code panelLayout}, you can use this method to simply
* attach them to non-layout-conflict. otherwise you can use {@link #attach(View, View, View)} or
Expand All @@ -118,7 +127,7 @@ public boolean onTouch(View v, MotionEvent event) {
*/
public static void attach(final View panelLayout,
final View focusView,
final SwitchClickListener switchClickListener,
/** Nullable **/ final SwitchClickListener switchClickListener,
SubPanelAndTrigger... subPanelAndTriggers) {
final Activity activity = (Activity) panelLayout.getContext();

Expand Down Expand Up @@ -272,7 +281,7 @@ static boolean isHandleByPlaceholder(final Activity activity) {
private static void bindSubPanel(final SubPanelAndTrigger subPanelAndTrigger,
final SubPanelAndTrigger[] subPanelAndTriggers,
final View focusView, final View panelLayout,
final SwitchClickListener switchClickListener) {
/** Nullable **/final SwitchClickListener switchClickListener) {

final View triggerView = subPanelAndTrigger.triggerView;
final View boundTriggerSubPanelView = subPanelAndTrigger.subPanelView;
Expand Down

0 comments on commit c2f05a4

Please sign in to comment.