Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuickAction was adapted to HD-screens. #18

Open
wants to merge 3 commits 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
1 change: 1 addition & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
42 changes: 24 additions & 18 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,43 @@
** Author: Lorensius W. L. T <[email protected]>
**
*/
-->
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.londatiga.android"
android:versionCode="1"
android:versionName="1.0">

<application android:icon="@drawable/icon" android:label="@string/app_name">

<activity android:name=".QuickActionActivity"
android:label="@string/app_name">
package="net.londatiga.android"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="15" />

<application
android:icon="@drawable/icon"
android:label="@string/app_name" >
<activity
android:name=".QuickActionActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".Example1Activity"
android:label="@string/app_name">
<activity
android:name=".Example1Activity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>

<activity android:name=".Example2Activity"
android:label="@string/app_name">
<activity
android:name=".Example2Activity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>

</application>

</manifest>
</manifest>
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Version 1.0.0 *(2011-10-20)*
7. Updated NewQuickAction3DActivity to show the toast message based on label of action item clicked as you now have enough info in callback to do that generically
3. New listener to handle on dismiss event.
4. Fix force close that occured when tapping randomly on a view to show QuickAction dialog ([issue](https://github.com/lorensiuswlt/NewQuickAction3D/issues/2)). Thanx to [Zammbi]([email protected]) for bug fixing..
5. Add __Apache License, Version 2.0__ to this source code (see LICENSE.txt)
5. Add __Apache License, Version 2.0__ to this source code (see LICENSE.txt)
6. QuickAction was adapted to HD-screens. By Maksim Bartosh <[email protected]>
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ NewQuickAction

NewQuickAction is a small android library to create QuickAction dialog.

Hi, i fixs bug in shown QuickAction at larges screens.

QuickAction correctly shown at small screens, her width is width of screen.
And QuickActtion correctly shown at large screen, and her width value is MAX_WIDTH_POPUP_WINDOWS constant. Arrow shown is correctly, too.

Add constant MAX_WIDTH_POPUP_WINDOWS;
Set min SDK version(API 7, as before) and target SDK version(API 15).


How to Use
==========
This repo includes a sample Activity (__ExampleActivity1.java__) to show how to use QuickAction.
Expand Down Expand Up @@ -79,6 +88,7 @@ Developed By
============

* Lorensius W. L. T - <[email protected]>
* Maksim Bartosh <[email protected]>

Contributors
============
Expand All @@ -105,4 +115,4 @@ License
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.
limitations under the License.
Binary file modified bin/NewQuickAction.apk
Binary file not shown.
Binary file modified bin/classes.dex
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/Example1Activity$1.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/Example1Activity$2.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/Example1Activity$3.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/Example1Activity$4.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/Example1Activity.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/Example2Activity$3.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/Example2Activity.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/NewQAAdapter.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/PopupWindows$1.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/PopupWindows.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/QuickAction$1.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/QuickAction$2$1.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/QuickAction$2.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/QuickAction.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/QuickActionActivity.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/R$drawable.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/R$id.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/R$layout.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/R$string.class
Binary file not shown.
Binary file modified bin/classes/net/londatiga/android/R$style.class
Binary file not shown.
Binary file modified bin/resources.ap_
Binary file not shown.
47 changes: 24 additions & 23 deletions gen/net/londatiga/android/R.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,34 @@ public static final class drawable {
public static final int icon=0x7f020005;
public static final int quickaction_arrow_down=0x7f020006;
public static final int quickaction_arrow_up=0x7f020007;
public static final int quickaction_background=0x7f020008;
public static final int quickaction_bottom_frame=0x7f020009;
public static final int quickaction_slider_background=0x7f02000a;
public static final int quickaction_slider_btn=0x7f02000b;
public static final int quickaction_slider_btn_normal=0x7f02000c;
public static final int quickaction_slider_btn_on=0x7f02000d;
public static final int quickaction_slider_btn_pressed=0x7f02000e;
public static final int quickaction_slider_btn_selected=0x7f02000f;
public static final int quickaction_slider_grip_left=0x7f020010;
public static final int quickaction_slider_grip_right=0x7f020011;
public static final int quickaction_top_frame=0x7f020012;
public static final int quickcontact_drop_shadow=0x7f020013;
public static final int textfield_default=0x7f020014;
public static final int quickaction_bottom_frame=0x7f020008;
public static final int quickaction_slider_background=0x7f020009;
public static final int quickaction_slider_btn=0x7f02000a;
public static final int quickaction_slider_btn_normal=0x7f02000b;
public static final int quickaction_slider_btn_on=0x7f02000c;
public static final int quickaction_slider_btn_pressed=0x7f02000d;
public static final int quickaction_slider_btn_selected=0x7f02000e;
public static final int quickaction_slider_grip_left=0x7f02000f;
public static final int quickaction_slider_grip_right=0x7f020010;
public static final int quickaction_top_frame=0x7f020011;
public static final int quickcontact_drop_shadow=0x7f020012;
public static final int textfield_default=0x7f020013;
}
public static final class id {
public static final int arrow_down=0x7f07000c;
public static final int arrow_up=0x7f070008;
public static final int arrow_down=0x7f07000e;
public static final int arrow_up=0x7f07000a;
public static final int btn1=0x7f070002;
public static final int btn2=0x7f070003;
public static final int footer=0x7f07000b;
public static final int header2=0x7f070007;
public static final int i_more=0x7f070005;
public static final int btn2=0x7f070005;
public static final int btn3=0x7f070003;
public static final int btn4=0x7f070004;
public static final int footer=0x7f07000d;
public static final int header2=0x7f070009;
public static final int i_more=0x7f070007;
public static final int iv_icon=0x7f070000;
public static final int l_list=0x7f070004;
public static final int scroll=0x7f070009;
public static final int t_name=0x7f070006;
public static final int tracks=0x7f07000a;
public static final int l_list=0x7f070006;
public static final int scroll=0x7f07000b;
public static final int t_name=0x7f070008;
public static final int tracks=0x7f07000c;
public static final int tv_title=0x7f070001;
}
public static final class layout {
Expand Down
2 changes: 1 addition & 1 deletion project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# project structure.

# Project target.
target=android-7
target=android-14
18 changes: 18 additions & 0 deletions res/layout/example1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@
android:padding="30dp"
android:text="Button 1"/>

<Button
android:id="@+id/btn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="10dp"
android:padding="30dp"
android:text="Button 3" />

<Button
android:id="@+id/btn4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:padding="30dp"
android:text="Button 4" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
19 changes: 17 additions & 2 deletions src/net/londatiga/android/Example1Activity.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ protected void onCreate(Bundle savedInstanceState) {
ActionItem addItem = new ActionItem(ID_ADD, "Add", getResources().getDrawable(R.drawable.ic_add));
ActionItem acceptItem = new ActionItem(ID_ACCEPT, "Accept", getResources().getDrawable(R.drawable.ic_accept));
ActionItem uploadItem = new ActionItem(ID_UPLOAD, "Upload", getResources().getDrawable(R.drawable.ic_up));

//use setSticky(true) to disable QuickAction dialog being dismissed after an item is clicked
uploadItem.setSticky(true);

Expand All @@ -40,7 +39,7 @@ protected void onCreate(Bundle savedInstanceState) {
mQuickAction.addActionItem(addItem);
mQuickAction.addActionItem(acceptItem);
mQuickAction.addActionItem(uploadItem);

//setup the action item click listener
mQuickAction.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {
@Override
Expand Down Expand Up @@ -78,5 +77,21 @@ public void onClick(View v) {
mQuickAction.setAnimStyle(QuickAction.ANIM_GROW_FROM_CENTER);
}
});
// right button
Button btn3 = (Button) this.findViewById(R.id.btn3);
btn3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mQuickAction.show(v);
}
});
// center button
Button btn4 = (Button) this.findViewById(R.id.btn4);
btn4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mQuickAction.show(v);
}
});
}
}
5 changes: 4 additions & 1 deletion src/net/londatiga/android/PopupWindows.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class PopupWindows {
protected View mRootView;
protected Drawable mBackground = null;
protected WindowManager mWindowManager;
public static final int MAX_WIDTH_POPUP_WINDOWS = 450;

/**
* Constructor.
Expand Down Expand Up @@ -76,7 +77,9 @@ protected void preShow() {
else
mWindow.setBackgroundDrawable(mBackground);

mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
int screenWidth = mWindowManager.getDefaultDisplay().getWidth();
int w = screenWidth < MAX_WIDTH_POPUP_WINDOWS ? screenWidth : MAX_WIDTH_POPUP_WINDOWS;
mWindow.setWidth(w);//WindowManager.LayoutParams.WRAP_CONTENT);
mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
mWindow.setTouchable(true);
mWindow.setFocusable(true);
Expand Down
Loading