Skip to content

Commit

Permalink
添加素材和demo布局
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuRi committed Jan 24, 2017
1 parent 3551f37 commit 3fbe80e
Show file tree
Hide file tree
Showing 18 changed files with 248 additions and 25 deletions.
1 change: 1 addition & 0 deletions LemonHello4Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ buildscript {
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}

Expand Down
1 change: 1 addition & 0 deletions LemonHello4Android/lemonhello-samples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ dependencies {
})
testCompile 'junit:junit:4.12'
compile project(':lemonhello')
compile 'com.github.1em0nsOft:LemonBubble4Android:1.0.9'
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/logo"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import net.lemonsoft.lemonhello.LemonHello;
import net.lemonsoft.lemonhello.LemonHelloAction;
Expand All @@ -28,25 +29,70 @@

public class MainActivity extends Activity {

private Button sButton;
private LinearLayout btn_success;
private LinearLayout btn_error;
private LinearLayout btn_warning;
private LinearLayout btn_information;
private LinearLayout btn_bookmark;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
sButton = (Button) findViewById(R.id.sButton);
sButton.setOnClickListener(new View.OnClickListener() {

btn_success = (LinearLayout) findViewById(R.id.btn_success);
btn_error = (LinearLayout) findViewById(R.id.btn_error);
btn_warning = (LinearLayout) findViewById(R.id.btn_warning);
btn_information = (LinearLayout) findViewById(R.id.btn_information);
btn_bookmark = (LinearLayout) findViewById(R.id.btn_bookmark);

initFunctions();

// sButton = (Button) findViewById(R.id.sButton);
// sButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// LemonHello.getSuccessHello("要删除\"LemonKit\"吗?", "您选择删除后会同时删除应用内的所有数据,确认删除吗?")
// .setIconWidth(80)
// .addAction(new LemonHelloAction("取消", Color.argb(255, 0, 120, 215), new LemonHelloActionDelegate() {
// @Override
// public void onClick(LemonHelloView helloView, LemonHelloInfo helloInfo, LemonHelloAction helloAction) {
// helloView.hide();
// }
// }))
// .addAction(new LemonHelloAction("删除", Color.RED, new LemonHelloActionDelegate() {
// @Override
// public void onClick(LemonHelloView helloView, LemonHelloInfo helloInfo, LemonHelloAction helloAction) {
// helloView.hide();
// }
// }))
// .show(MainActivity.this);
// }
// });
}

private void initFunctions() {

// 成功按钮被点击
btn_success.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LemonHello.getSuccessHello("要删除\"LemonKit\"吗?", "您选择删除后会同时删除应用内的所有数据,确认删除吗?")
.setIconWidth(80)
.addAction(new LemonHelloAction("取消", Color.argb(255, 0, 120, 215), new LemonHelloActionDelegate() {
LemonHello.getSuccessHello("提交成功", "恭喜您,您所填写的数据已经全部提交成功,我们的客服人员将在24小时内进行审核,请耐心等待.")
.addAction(new LemonHelloAction("我知道啦", new LemonHelloActionDelegate() {
@Override
public void onClick(LemonHelloView helloView, LemonHelloInfo helloInfo, LemonHelloAction helloAction) {
helloView.hide();
}
}))
.addAction(new LemonHelloAction("删除", Color.RED, new LemonHelloActionDelegate() {
.show(MainActivity.this);
}
});

btn_error.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LemonHello.getErrorHello("发生错误", "对不起,您没有权限删除此数据,请联系系统管理员进行操作,谢谢。")
.addAction(new LemonHelloAction("关闭", new LemonHelloActionDelegate() {
@Override
public void onClick(LemonHelloView helloView, LemonHelloInfo helloInfo, LemonHelloAction helloAction) {
helloView.hide();
Expand All @@ -55,5 +101,7 @@ public void onClick(LemonHelloView helloView, LemonHelloInfo helloInfo, LemonHel
.show(MainActivity.this);
}
});


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF" />
<stroke
android:width="2px"
android:color="#AAAAAA" />
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
</shape>
Original file line number Diff line number Diff line change
@@ -1,20 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="lemonsoft.net.lemonhello4android.MainActivity">

<Button
android:id="@+id/sButton"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#abcdef"
android:text="S" />

</RelativeLayout>
android:layout_margin="6dp"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/btn_success"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="@drawable/round_function_button"
android:orientation="vertical"
android:padding="16dp">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/icon_success" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center_horizontal"
android:text="成功对话框"
android:textSize="10dp" />
</LinearLayout>

<LinearLayout
android:id="@+id/btn_error"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="@drawable/round_function_button"
android:orientation="vertical"
android:padding="16dp">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/icon_error" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center_horizontal"
android:text="错误对话框"
android:textSize="10dp" />
</LinearLayout>

<LinearLayout
android:id="@+id/btn_warning"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="@drawable/round_function_button"
android:orientation="vertical"
android:padding="16dp">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/icon_warning" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center_horizontal"
android:text="警告对话框"
android:textSize="10dp" />
</LinearLayout>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/btn_information"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="@drawable/round_function_button"
android:orientation="vertical"
android:padding="16dp">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/icon_information" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center_horizontal"
android:text="信息提示框"
android:textSize="10dp" />
</LinearLayout>

<LinearLayout
android:id="@+id/btn_bookmark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="@drawable/round_function_button"
android:orientation="vertical"
android:padding="16dp">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/icon_bookmark" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center_horizontal"
android:text="图标对话框"
android:textSize="10dp" />
</LinearLayout>

<LinearLayout
android:id="@+id/btn_custom"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="@drawable/round_function_button"
android:orientation="vertical"
android:padding="16dp">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/icon_warning" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center_horizontal"
android:text="自定义对话框"
android:textSize="10dp" />
</LinearLayout>

</LinearLayout>
</LinearLayout>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:actionBarStyle">@style/myActionBarStyle</item>
</style>

<style name="myActionBarStyle" parent="android:Widget.ActionBar">  
<item name="android:background">#3399FF</item>          
<item name="android:titleTextStyle">@style/AcBar_titleStyle</item>
</style>


<style name="AcBar_titleStyle">
<item name="android:textSize">18sp</item>
<item name="android:textColor">#FFFFFF</item>      
</style>

</resources>

0 comments on commit 3fbe80e

Please sign in to comment.