forked from aiselp/AutoX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: floating window, layout inspector
- Loading branch information
hyb1996
committed
Mar 12, 2017
1 parent
a211d20
commit e81b661
Showing
164 changed files
with
7,043 additions
and
1,204 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.stardust; | ||
|
||
/** | ||
* Created by Stardust on 2017/3/8. | ||
*/ | ||
|
||
public class Test { | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
app/src/main/java/com/stardust/app/OnActivityResultDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
app/src/main/java/com/stardust/hover/HoverMenuBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package com.stardust.hover; | ||
|
||
import android.content.Context; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
import android.view.ViewGroup; | ||
import android.view.WindowManager; | ||
|
||
import io.mattcarroll.hover.HoverMenu; | ||
import io.mattcarroll.hover.HoverMenuAdapter; | ||
import io.mattcarroll.hover.Navigator; | ||
import io.mattcarroll.hover.defaulthovermenu.view.ViewHoverMenu; | ||
|
||
/** | ||
* Created by Stardust on 2017/3/11. | ||
*/ | ||
|
||
public class HoverMenuBuilder { | ||
|
||
public static final int DISPLAY_MODE_WINDOW = 1; // Display directly in a window. | ||
public static final int DISPLAY_MODE_VIEW = 2; // Display within View hierarchy. | ||
|
||
private Context mContext; | ||
private int mDisplayMode = DISPLAY_MODE_WINDOW; | ||
private WindowManager mWindowManager; | ||
private Navigator mNavigator; | ||
private HoverMenuAdapter mAdapter; | ||
private String mSavedVisualState = null; | ||
|
||
public HoverMenuBuilder(@NonNull Context context) { | ||
mContext = context; | ||
} | ||
|
||
public HoverMenuBuilder displayWithinWindow() { | ||
mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); | ||
mDisplayMode = DISPLAY_MODE_WINDOW; | ||
return this; | ||
} | ||
|
||
public HoverMenuBuilder displayWithinView(@NonNull ViewGroup container) { | ||
mDisplayMode = DISPLAY_MODE_VIEW; | ||
return this; | ||
} | ||
|
||
public HoverMenuBuilder useNavigator(@Nullable Navigator navigator) { | ||
mNavigator = navigator; | ||
return this; | ||
} | ||
|
||
public HoverMenuBuilder useAdapter(@Nullable HoverMenuAdapter adapter) { | ||
mAdapter = adapter; | ||
return this; | ||
} | ||
|
||
public HoverMenuBuilder restoreVisualState(@NonNull String visualState) { | ||
mSavedVisualState = visualState; | ||
return this; | ||
} | ||
|
||
public HoverMenu build() { | ||
if (DISPLAY_MODE_WINDOW == mDisplayMode) { | ||
WindowHoverMenu windowHoverMenu = new WindowHoverMenu(mContext, mWindowManager, mNavigator, mSavedVisualState); | ||
windowHoverMenu.setAdapter(mAdapter); | ||
return windowHoverMenu; | ||
} else { | ||
ViewHoverMenu viewHoverMenu = new ViewHoverMenu(mContext); | ||
viewHoverMenu.setAdapter(mAdapter); | ||
return viewHoverMenu; | ||
} | ||
} | ||
} |
Oops, something went wrong.