├── README.md
└── TitleBar
├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── TitleBar.iml
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── titlebar
│ │ └── haizitong
│ │ └── titlebar
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── titlebar
│ │ └── haizitong
│ │ └── titlebar
│ │ ├── BaseActivity.java
│ │ ├── TitleBarTestActivity.java
│ │ └── TitleBuilder.java
│ └── res
│ ├── drawable-hdpi
│ ├── ic_back_arrow.png
│ ├── ic_menu.png
│ ├── ic_msg_dot.png
│ ├── icon_top_category_disable.png
│ ├── icon_top_category_pressed.png
│ ├── tab_icon_talk.png
│ └── tab_icon_talk_pressed.png
│ ├── drawable
│ └── tab_selector_talk.xml
│ ├── layout
│ ├── activity_main.xml
│ ├── activity_test.xml
│ └── title_layout_activity.xml
│ ├── menu
│ └── menu_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/README.md:
--------------------------------------------------------------------------------
1 | # android-titlebar
2 | Android titleBar可以直接集成到每一个页面不需include布局文件,在BaseActivity集成。
3 | 不需要重新设置title,也不需要include。
4 |
5 | 加载页面的速度也提高很多;
6 |
7 |
8 | 关注公众号:
9 | QXF069
10 |
11 | 
12 |
13 |
--------------------------------------------------------------------------------
/TitleBar/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | /gradle
10 | TitleBar.iml
11 |
--------------------------------------------------------------------------------
/TitleBar/.idea/.name:
--------------------------------------------------------------------------------
1 | TitleBar
--------------------------------------------------------------------------------
/TitleBar/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/TitleBar/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/TitleBar/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 |
--------------------------------------------------------------------------------
/TitleBar/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/TitleBar/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/TitleBar/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/TitleBar/TitleBar.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/TitleBar/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/TitleBar/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | generateDebugSources
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/TitleBar/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "25.0.3"
6 |
7 | defaultConfig {
8 | applicationId "com.titlebar.haizitong.titlebar"
9 | minSdkVersion 15
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:23.0.1'
25 | // compile project(':autolayout')
26 | compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
27 | }
28 |
--------------------------------------------------------------------------------
/TitleBar/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\software\adt-bundle-windows-x86_64-20140702\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/TitleBar/app/src/androidTest/java/com/titlebar/haizitong/titlebar/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.titlebar.haizitong.titlebar;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/TitleBar/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/java/com/titlebar/haizitong/titlebar/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.titlebar.haizitong.titlebar;
2 |
3 | import android.app.Activity;
4 | import android.graphics.Color;
5 | import android.os.Build;
6 | import android.os.Bundle;
7 | import android.util.DisplayMetrics;
8 | import android.util.Log;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.view.ViewTreeObserver;
12 | import android.view.Window;
13 | import android.view.WindowManager;
14 | import android.widget.RelativeLayout;
15 | import android.widget.ScrollView;
16 | import android.widget.Toast;
17 |
18 | import com.readystatesoftware.systembartint.SystemBarTintManager;
19 |
20 | import java.lang.reflect.Field;
21 |
22 |
23 | public abstract class BaseActivity extends Activity implements TitleBuilder.TitleBuilderListener {
24 | public TitleBuilder mTitleBuilder;
25 |
26 | private int TitleBarVisible;
27 | private boolean isChanageStatus = true;
28 | private boolean isFullScreen = false;
29 | private boolean isFirst = false;
30 |
31 | @Override
32 | protected void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | // setContentView(R.layout.activity_main);
35 | }
36 |
37 | @Override
38 | public void setContentView(int id) {
39 | this.TitleBarVisible = View.VISIBLE;
40 | mTitleBuilder = new TitleBuilder(this);
41 | this.setToolBarVisible(this.TitleBarVisible);
42 | super.setContentView(mTitleBuilder.initBar(id));
43 | this.initToolBar(mTitleBuilder);
44 | this.setFullScreen(isFullScreen);
45 | mTitleBuilder.setTitleBuilderListener(this);
46 | setStatusBar(this.getTitleColor(),isChanageStatus);
47 | }
48 |
49 | @Override
50 | public void onButtonClicked(TitleBuilder.TitleButton clicked) {
51 | switch (clicked) {
52 | case LEFT:
53 | finish();
54 | Toast.makeText(this, "this is back", Toast.LENGTH_SHORT).show();
55 | break;
56 | }
57 | }
58 |
59 | public abstract void initToolBar(TitleBuilder mTitleBuilder);
60 |
61 | /**
62 | * 设置title是否可见 默认是可见状态
63 | *
64 | * @param visible
65 | */
66 | public void setToolBarVisible(int visible) {
67 | if (this.mTitleBuilder.mTitleView != null) {
68 | if (this.TitleBarVisible == visible)
69 | return;
70 | this.mTitleBuilder.mTitleView.setVisibility(visible);
71 | }
72 | this.TitleBarVisible = visible;
73 | }
74 |
75 | /**
76 | * 设置状态的属性
77 | *
78 | * @param statusBar
79 | */
80 | public void setStatusBar(int statusColor,boolean statusBar) {
81 | this.isChanageStatus = statusBar;
82 | if (statusBar) {
83 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
84 | Window win = getWindow();
85 | WindowManager.LayoutParams winParams = win.getAttributes();
86 | final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
87 | winParams.flags |= bits;
88 | win.setAttributes(winParams);
89 | }
90 | //透明状态栏
91 | SystemBarTintManager tintManager = new SystemBarTintManager(this);
92 | tintManager.setStatusBarTintEnabled(true);
93 | tintManager.setStatusBarTintColor(statusColor);
94 | //getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
95 | tintManager.setNavigationBarTintEnabled(true);
96 | //透明导航栏
97 | // getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
98 | }
99 | }
100 |
101 | public void setFullScreen(boolean isFullScreen) {
102 | // if (isFullScreen) {
103 | // getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
104 | // }else{
105 | // //getWindow().setFlags(WindowManager.LayoutParams.F,WindowManager.LayoutParams.FLAG_FULLSCREEN);
106 | // }
107 | this.isFullScreen = isFullScreen;
108 | if (isFullScreen) {
109 | WindowManager.LayoutParams lp = getWindow().getAttributes();
110 | lp.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
111 | getWindow().setAttributes(lp);
112 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
113 | getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
114 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
115 | WindowManager.LayoutParams.FLAG_FULLSCREEN);
116 | this.setToolBarVisible(View.GONE);
117 | } else {
118 | WindowManager.LayoutParams attr = getWindow().getAttributes();
119 | attr.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
120 | getWindow().setAttributes(attr);
121 | getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
122 | this.setToolBarVisible(View.VISIBLE);
123 | }
124 | }
125 |
126 | @Override
127 | protected void onResume() {
128 | this.setContentScreen();
129 | super.onResume();
130 | }
131 |
132 | private float getScreenHeight() {
133 | DisplayMetrics dm = new DisplayMetrics();
134 | getWindowManager().getDefaultDisplay().getMetrics(dm);
135 | return dm.heightPixels;
136 | }
137 |
138 | private void setContentScreen() {
139 | int widthSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
140 | int heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
141 | mTitleBuilder.mRootView.measure(widthSpec, heightSpec);
142 | mTitleBuilder.mTitleView.measure(widthSpec, heightSpec);
143 | mTitleBuilder.mRootView.getViewTreeObserver().addOnPreDrawListener(
144 | new ViewTreeObserver.OnPreDrawListener() {
145 |
146 | @Override
147 | public boolean onPreDraw() {
148 | float height;
149 | if(isFullScreen){
150 | height = mTitleBuilder.mRootView.getMeasuredHeight();
151 | }else if (TitleBarVisible == View.GONE){
152 | height = mTitleBuilder.mRootView.getMeasuredHeight() + getStatusBarHeight();
153 | }else{
154 | height = mTitleBuilder.mRootView.getMeasuredHeight() + mTitleBuilder.mTitleView.getMeasuredHeight() + getStatusBarHeight();
155 | }
156 | Log.e("qxf", "height:" + height + "getScreenHeight():" + getScreenHeight() + "content" + mTitleBuilder.mRootView.getMeasuredHeight());
157 | if (!isFirst) {
158 | if (height+1 > getScreenHeight()) {
159 | isFirst = true;
160 | Log.e("qxf", "height:" + height + "getScreenHeight():" + getScreenHeight());
161 | ViewGroup viewParent = (ViewGroup) mTitleBuilder.mRootView.getParent();
162 | Log.e("qxf", viewParent + "111111111");
163 | if (viewParent != null)
164 | viewParent.removeView(mTitleBuilder.mRootView);
165 | ScrollView scrollView = new ScrollView(BaseActivity.this);
166 | RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
167 | rl.addRule(RelativeLayout.BELOW, R.id.title_bar_id);
168 | scrollView.setLayoutParams(rl);
169 | scrollView.setBackgroundColor(getResources().getColor(R.color.withe));
170 | // viewParent.addView(mTitleBuilder.mTitleView);
171 | scrollView.addView(mTitleBuilder.mRootView);
172 | viewParent.addView(scrollView);
173 |
174 | } else {
175 | Log.e("qxf", "getScreenHeight():" + getScreenHeight() + "mTitleBuilder.mRootView.getHeight()" + height);
176 | }
177 | }
178 | return true;
179 | }
180 | });
181 | }
182 |
183 | private float getStatusBarHeight() {
184 | Class> c = null;
185 | Object obj = null;
186 | Field field = null;
187 | int x = 0, sbar = 0;
188 | try {
189 | c = Class.forName("com.android.internal.R$dimen");
190 | obj = c.newInstance();
191 | field = c.getField("status_bar_height");
192 | x = Integer.parseInt(field.get(obj).toString());
193 | sbar = getResources().getDimensionPixelSize(x);
194 | } catch (Exception e1) {
195 | Log.e("qxf", "get status bar height fail" + e1);
196 | e1.printStackTrace();
197 | }
198 | return sbar;
199 | }
200 |
201 | }
202 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/java/com/titlebar/haizitong/titlebar/TitleBarTestActivity.java:
--------------------------------------------------------------------------------
1 | package com.titlebar.haizitong.titlebar;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 | import android.widget.Toast;
6 |
7 | /**
8 | * Created by qiuxianfu
9 | * Date: 2016-01-13
10 | * Time: 20:21
11 | * FIXME
12 | */
13 | public class TitleBarTestActivity extends BaseActivity {
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | //super.setToolBarVisible(View.GONE);
18 | this.setStatusBar(R.color.actionbar_bg,true);
19 | setContentView(R.layout.activity_test);
20 | }
21 |
22 | @Override
23 | public void initToolBar(TitleBuilder mTitleBuilder) {
24 | mTitleBuilder.setLeftText("");
25 | mTitleBuilder.setMiddleTitleText("测试activity标题测试activity标题测试activity标题测试activity标题测试activity标题测试activity标题测试activity标题");
26 | mTitleBuilder.setRightText("下一步");
27 | mTitleBuilder.setRightImageRes(R.drawable.tab_icon_talk);
28 | mTitleBuilder.setTipsVisible(View.VISIBLE);
29 | }
30 |
31 | /**
32 | * 重载父类的方法直接操作
33 | * @param clicked
34 | */
35 | @Override
36 | public void onButtonClicked(TitleBuilder.TitleButton clicked) {
37 | switch (clicked){
38 | case LEFT:
39 | Toast.makeText(this, "this is back", Toast.LENGTH_SHORT).show();
40 | this.setFullScreen(false);
41 | break;
42 | case MIDDLE:
43 | Toast.makeText(this, "this is middle", Toast.LENGTH_SHORT).show();
44 | this.setFullScreen(false);
45 | break;
46 | case RIGHT:
47 | Toast.makeText(this, "this is back", Toast.LENGTH_SHORT).show();
48 | this.setFullScreen(true);
49 | break;
50 | }
51 | }
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/java/com/titlebar/haizitong/titlebar/TitleBuilder.java:
--------------------------------------------------------------------------------
1 | package com.titlebar.haizitong.titlebar;
2 |
3 | import android.app.Activity;
4 | import android.text.TextUtils;
5 | import android.util.Log;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.Button;
10 | import android.widget.ImageView;
11 | import android.widget.RelativeLayout;
12 | import android.widget.ScrollView;
13 | import android.widget.TextView;
14 |
15 |
16 | /**
17 | * name qiuxianfu
18 | * 2016/3/17.
19 | */
20 | public class TitleBuilder implements View.OnClickListener{
21 |
22 | /**
23 | * title栏根布局
24 | */
25 | protected View mTitleView;// titleView
26 | protected RelativeLayout mTitleBgColor;
27 | protected RelativeLayout mTitleLeftRelativeLayout;//title左边布局
28 | protected RelativeLayout mTitleMiddleRelativeLayout;//title中间布局
29 | protected RelativeLayout mTitleRightRelativeLayout;//title右边布局
30 | protected ImageView mTitleLeftImageView;//title左边icon显示
31 | protected Button mTitleLeftButton;//title左边文本显示
32 | protected TextView mTitleMiddleTextView;//title中间文本显示
33 | protected TextView mSubTitleTextView;//副标题文本显示
34 | protected TextView mTitleRightTextView;//title右边文本显示
35 | protected ImageView mTitleRightImageView;//title右边图片显示
36 | protected ImageView mTitleRightTips;//title右边小红点提示
37 | public View mRootView;
38 | public RelativeLayout relativeLayout;
39 | private ScrollView mScrollView;
40 | private Activity activity;
41 | private TitleBuilderListener mListener;
42 |
43 |
44 |
45 | public enum TitleButton {
46 | LEFT, MIDDLE, RIGHT
47 | }
48 | /**
49 | * 第一种 初始化方式
50 | * 定义一个容器加载title xml和activity布局文件
51 | * @param activity
52 | */
53 | public TitleBuilder(Activity activity) {
54 | this.activity = activity;
55 | }
56 |
57 | /**
58 | *设置一个布局容器,装载title_layout和传进来的layoutId 返回一个View视图
59 | * @param layoutId
60 | * @return
61 | */
62 | protected View initBar(int layoutId){
63 | relativeLayout = new RelativeLayout(activity);
64 | mScrollView = new ScrollView(activity);
65 | RelativeLayout.LayoutParams rootLl = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
66 | relativeLayout.setLayoutParams(rootLl);
67 | mTitleView = activity.getLayoutInflater().inflate(R.layout.title_layout_activity,null);
68 | mTitleBgColor = (RelativeLayout) mTitleView.findViewById(R.id.title_bar_id);
69 | mTitleLeftRelativeLayout = (RelativeLayout) mTitleView.findViewById(R.id.left_relative_layout);
70 | mTitleMiddleRelativeLayout = (RelativeLayout) mTitleView.findViewById(R.id.mid_relative_layout);
71 | mTitleRightRelativeLayout = (RelativeLayout) mTitleView.findViewById(R.id.right_relative_layout);
72 | mTitleLeftImageView = (ImageView) mTitleView.findViewById(R.id.left_icon_title);
73 | mTitleLeftButton = (Button) mTitleView.findViewById(R.id.left_btn);
74 | mTitleMiddleTextView = (TextView) mTitleView.findViewById(R.id.middle_text);
75 | mSubTitleTextView = (TextView) mTitleView.findViewById(R.id.middle_sub_text);
76 | mTitleRightTextView = (TextView) mTitleView.findViewById(R.id.title_right_text);
77 | mTitleRightImageView = (ImageView) mTitleView.findViewById(R.id.title_right_image_view);
78 | mTitleRightTips = (ImageView) mTitleView.findViewById(R.id.right_new_info);
79 | mRootView = LayoutInflater.from(activity).inflate(layoutId,null);//activity布局文件
80 | RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
81 | rl.addRule(RelativeLayout.BELOW, R.id.title_bar_id);
82 | relativeLayout.addView(mTitleView);
83 | relativeLayout.setClipToPadding(false);
84 | relativeLayout.setFitsSystemWindows(true);
85 | relativeLayout.addView(mRootView);
86 | mRootView.setLayoutParams(rootLl);
87 | // RelativeLayout.LayoutParams rl = (RelativeLayout.LayoutParams) mRootView.getLayoutParams();//面板没有全屏
88 | Log.e("qxf","mRootView.getWidth():"+mRootView.getWidth()+"mRootView.getHeight():"+mRootView.getHeight()+"mRootView.getMeasuredWidth():"+mRootView.getMeasuredWidth());
89 | mTitleLeftButton.setOnClickListener(this);
90 | mTitleLeftRelativeLayout.setOnClickListener(this);
91 | mTitleRightRelativeLayout.setOnClickListener(this);
92 | mTitleMiddleRelativeLayout.setOnClickListener(this);
93 |
94 | return relativeLayout;
95 | }
96 |
97 | /**
98 | * 第二种初始化方式
99 | * 这里是比如你用代码创建布局的时候使用
100 | * @param context
101 | */
102 | public TitleBuilder(View context) {
103 |
104 | mTitleView = context.findViewById(R.id.title_bar_id);
105 |
106 | // mTitleLeftRelativeLayout = (RelativeLayout) mTitleView.findViewById(R.id.left_relative_layout);
107 | // mTitleMiddleRelativeLayout = (RelativeLayout) mTitleView.findViewById(R.id.mid_relative_layout);
108 | // mTitleRightRelativeLayout = (RelativeLayout) mTitleView.findViewById(R.id.right_relative_layout);
109 | mTitleLeftImageView = (ImageView) mTitleView.findViewById(R.id.left_icon_title);
110 | mTitleLeftButton = (Button) mTitleView.findViewById(R.id.left_btn);
111 | mTitleMiddleTextView = (TextView) mTitleView.findViewById(R.id.middle_text);
112 | mTitleRightTextView = (TextView) mTitleView.findViewById(R.id.title_right_text);
113 | mTitleRightImageView = (ImageView) mTitleView.findViewById(R.id.title_right_image_view);
114 | mTitleRightTips = (ImageView) mTitleView.findViewById(R.id.right_new_info);
115 |
116 |
117 | }
118 |
119 | /**
120 | * 设置左侧菜单显示图片
121 | * @param resId
122 | * @return
123 | */
124 | public TitleBuilder setLeftDrawable(int resId){
125 | mTitleLeftButton.setCompoundDrawablesWithIntrinsicBounds(resId, 0, 0, 0);
126 | return this;
127 | }
128 |
129 | /**
130 | * 左边文字按钮
131 | *
132 | * @param text
133 | * @return
134 | */
135 | public TitleBuilder setLeftText(String text) {
136 | // mTitleLeftButton.setVisibility(TextUtils.isEmpty(text) ? View.GONE : View.VISIBLE);
137 | mTitleLeftButton.setText(text);
138 | return this;
139 | }
140 |
141 | /**
142 | * 设置文本的颜色
143 | * @param colorId 颜色值的ID
144 | * @return
145 | */
146 | public TitleBuilder setLeftTextColor(int colorId){
147 | mTitleLeftButton.setTextColor(colorId);
148 | return this;
149 | }
150 | /**
151 | * title 的背景色
152 | */
153 |
154 | public TitleBuilder seTitleBgRes(int resId) {
155 | mTitleView.setBackgroundResource(resId);
156 |
157 | return this;
158 | }
159 | /**
160 | * title的文本
161 | *
162 | * @param text
163 | * @return
164 | */
165 | public TitleBuilder setMiddleTitleText(String text) {
166 |
167 | mTitleMiddleTextView.setVisibility(TextUtils.isEmpty(text) ? View.GONE
168 | : View.VISIBLE);
169 | mTitleMiddleTextView.setText(text);
170 |
171 | return this;
172 | }
173 |
174 | /**
175 | * 设置副标题
176 | * @param subTitleText
177 | * @return
178 | */
179 | public TitleBuilder setSubTitleText(String subTitleText){
180 | mSubTitleTextView.setVisibility(TextUtils.isEmpty(subTitleText) ? View.GONE
181 | : View.VISIBLE);
182 | mSubTitleTextView.setText(subTitleText);
183 | return this;
184 | }
185 |
186 | /**
187 | * 设置左边的事件
188 | */
189 | public TitleBuilder setLeftTextOrImageListener(View.OnClickListener listener) {
190 |
191 | if (mTitleLeftImageView.getVisibility() == View.VISIBLE) {
192 |
193 | mTitleLeftImageView.setOnClickListener(listener);
194 |
195 | } else if (mTitleLeftButton.getVisibility() == View.VISIBLE) {
196 |
197 | mTitleLeftButton.setOnClickListener(listener);
198 |
199 | }
200 |
201 | return this;
202 | }
203 |
204 | /**
205 | * right
206 | */
207 | /**
208 | * 图片按钮
209 | *
210 | * @param resId
211 | * @return
212 | */
213 | public TitleBuilder setRightImageRes(int resId) {
214 |
215 | mTitleRightImageView.setVisibility(resId > 0 ? View.VISIBLE : View.GONE);
216 | mTitleRightImageView.setBackgroundResource(resId);
217 |
218 | return this;
219 | }
220 |
221 | /**
222 | * 左边文字按钮
223 | *
224 | * @param text
225 | * @return
226 | */
227 | public TitleBuilder setRightText(String text) {
228 |
229 | mTitleRightTextView.setVisibility(TextUtils.isEmpty(text) ? View.GONE:View.VISIBLE);
230 | mTitleRightTextView.setText(text);
231 |
232 | return this;
233 | }
234 |
235 | /**
236 | *设置tips图片
237 | * @param resId
238 | * @return
239 | */
240 | public TitleBuilder setTipsDrawable(int resId){
241 | mTitleRightTips.setVisibility(resId ==0 ? View.GONE : View.VISIBLE);
242 | mTitleRightTips.setBackgroundResource(resId);
243 | return this;
244 | }
245 | public TitleBuilder setTipsVisible(int visible){
246 | if (mTitleRightTips.getVisibility() == visible){
247 | return this;
248 | }else{
249 | mTitleRightTips.setVisibility(visible);
250 | }
251 |
252 | return this;
253 | }
254 | /**
255 | * 设置左边的事件
256 | */
257 | public TitleBuilder setRightTextOrImageListener(View.OnClickListener listener) {
258 |
259 | if (mTitleRightImageView.getVisibility() == View.VISIBLE) {
260 |
261 | mTitleRightImageView.setOnClickListener(listener);
262 |
263 | } else if (mTitleRightTextView.getVisibility() == View.VISIBLE) {
264 |
265 | mTitleRightTextView.setOnClickListener(listener);
266 |
267 | }
268 |
269 | return this;
270 | }
271 |
272 | /**
273 | * 设置按钮是否可以使用
274 | * @param enable
275 | * @return
276 | */
277 | public TitleBuilder setLeftButtonEnabled(boolean enable){
278 | mTitleLeftButton.setEnabled(enable);
279 | return this;
280 | }
281 |
282 | /**
283 | * 设置title中间不可以操作
284 | * @param enable
285 | * @return
286 | */
287 | public TitleBuilder setMiddleTextViewEnabled(boolean enable){
288 | mTitleMiddleRelativeLayout.setEnabled(enable);
289 | return this;
290 | }
291 | /**
292 | * 设置title中间不可以操作
293 | * @param enable
294 | * @return
295 | */
296 | public TitleBuilder setRightViewEnabled(boolean enable){
297 | mTitleRightRelativeLayout.setEnabled(enable);
298 | return this;
299 | }
300 |
301 | /**
302 | * 设置监听事件
303 | * @param mTitleBuilderListener
304 | */
305 | public void setTitleBuilderListener(TitleBuilderListener mTitleBuilderListener){
306 | this.mListener = mTitleBuilderListener;
307 | }
308 | @Override
309 | public void onClick(View view) {
310 | if (mListener == null) {
311 | return;
312 | }
313 | if (view == mTitleLeftImageView|| view == mTitleLeftButton || view == mTitleLeftRelativeLayout){
314 | mListener.onButtonClicked(TitleButton.LEFT);
315 | }else if (view == mTitleMiddleTextView || view == mTitleMiddleRelativeLayout){
316 | mListener.onButtonClicked(TitleButton.MIDDLE);
317 | }
318 | else if(view == mTitleRightRelativeLayout || view == mTitleRightImageView || view == mTitleRightTextView){
319 | mListener.onButtonClicked(TitleButton.RIGHT);
320 | }
321 | }
322 | public interface TitleBuilderListener {
323 | void onButtonClicked(TitleButton clicked);
324 | }
325 | }
326 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/drawable-hdpi/ic_back_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/drawable-hdpi/ic_back_arrow.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/drawable-hdpi/ic_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/drawable-hdpi/ic_menu.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/drawable-hdpi/ic_msg_dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/drawable-hdpi/ic_msg_dot.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/drawable-hdpi/icon_top_category_disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/drawable-hdpi/icon_top_category_disable.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/drawable-hdpi/icon_top_category_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/drawable-hdpi/icon_top_category_pressed.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/drawable-hdpi/tab_icon_talk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/drawable-hdpi/tab_icon_talk.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/drawable-hdpi/tab_icon_talk_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/drawable-hdpi/tab_icon_talk_pressed.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/drawable/tab_selector_talk.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
9 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/layout/activity_test.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
22 |
23 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/layout/title_layout_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
14 |
22 |
33 |
34 |
35 |
44 |
58 |
74 |
75 |
76 |
77 |
83 |
84 |
92 |
100 |
101 |
102 |
103 |
111 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FF0099CC
4 | #FF006080
5 | #ffffff
6 |
7 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | TitleBar
3 | 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111******you
4 | Settings
5 |
6 |
--------------------------------------------------------------------------------
/TitleBar/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/TitleBar/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/TitleBar/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/TitleBar/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qxf323/android-titlebar/7244bcdb831678101f732b11124df6f2ec632c73/TitleBar/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/TitleBar/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/TitleBar/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/TitleBar/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/TitleBar/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------