@ -0,0 +1,168 @@
|
||||
body {
|
||||
font-family: 'Microsoft YaHei';
|
||||
}
|
||||
.wrap {
|
||||
position: fixed;
|
||||
width: 450px;
|
||||
left: 50%;
|
||||
margin-left: -225px;
|
||||
top: 20px;
|
||||
bottom: 20px;
|
||||
border: 1px solid #ebebeb;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
}
|
||||
.header {
|
||||
height: 55px;
|
||||
background: linear-gradient(90deg, rgba(246, 60, 47, 0.6), rgba(128, 58, 242, 0.6));
|
||||
overflow: hidden;
|
||||
}
|
||||
.header h3 {
|
||||
color: #faf3fc;
|
||||
line-height: 55px;
|
||||
font-weight: normal;
|
||||
float: left;
|
||||
letter-spacing: 2px;
|
||||
margin-left: 25px;
|
||||
font-size: 18px;
|
||||
text-shadow: 0px 0px 5px #944846;
|
||||
}
|
||||
.header img {
|
||||
float: right;
|
||||
margin: 7px 25px 0 0;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 0 5px #f7f2fe;
|
||||
}
|
||||
.main {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 55px;
|
||||
bottom: 55px;
|
||||
background-color: #f4f3f3;
|
||||
box-sizing: border-box;
|
||||
padding: 10px 0;
|
||||
overflow:hidden;
|
||||
}
|
||||
.talk_list{
|
||||
position: absolute;
|
||||
width:100%;
|
||||
left:0px;
|
||||
top:0px;
|
||||
}
|
||||
.talk_list li {
|
||||
overflow: hidden;
|
||||
margin: 20px 0px 30px;
|
||||
}
|
||||
.talk_list .left_word img {
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.talk_list .left_word span {
|
||||
float: left;
|
||||
background-color: #fe9697;
|
||||
padding: 10px 15px;
|
||||
max-width: 290px;
|
||||
border-radius: 12px;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
margin-left: 13px;
|
||||
position: relative;
|
||||
line-height: 24px;
|
||||
}
|
||||
.talk_list .left_word span:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: -8px;
|
||||
top: 3px;
|
||||
width: 13px;
|
||||
height: 12px;
|
||||
background: url('../img/corner01.png') no-repeat;
|
||||
}
|
||||
.talk_list .right_word img {
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.talk_list .right_word span {
|
||||
float: right;
|
||||
background-color: #fff;
|
||||
padding: 10px 15px;
|
||||
max-width: 290px;
|
||||
border-radius: 12px;
|
||||
font-size: 16px;
|
||||
color: #000;
|
||||
margin-right: 13px;
|
||||
position: relative;
|
||||
line-height: 24px;
|
||||
}
|
||||
.talk_list .right_word span:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: -8px;
|
||||
top: 3px;
|
||||
width: 13px;
|
||||
height: 12px;
|
||||
background: url('../img/corner02.png') no-repeat;
|
||||
}
|
||||
.drag_bar{
|
||||
position:absolute;
|
||||
right:0px;
|
||||
top:0px;
|
||||
background-color: #fff;
|
||||
height:100%;
|
||||
width:6px;
|
||||
box-sizing:border-box;
|
||||
border-bottom:1px solid #f4f3f3;
|
||||
}
|
||||
.drager{
|
||||
position:absolute;
|
||||
left:0px;
|
||||
top:0px;
|
||||
background-color: #cdcdcd;
|
||||
height:100px;
|
||||
width:6px;
|
||||
border-radius:3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.footer{
|
||||
width:100%;
|
||||
height: 55px;
|
||||
left:0px;
|
||||
bottom:0px;
|
||||
background-color:#fff;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.footer img{
|
||||
float: left;
|
||||
margin:8px 0 0 20px;
|
||||
}
|
||||
|
||||
.input_txt{
|
||||
float: left;
|
||||
width:270px;
|
||||
height:37px;
|
||||
border:0px;
|
||||
background-color: #f4f3f3;
|
||||
margin:9px 0 0 20px;
|
||||
border-radius:8px;
|
||||
padding:0px;
|
||||
outline:none;
|
||||
text-indent:15px;
|
||||
}
|
||||
.input_sub{
|
||||
float: left;
|
||||
width:70px;
|
||||
height:37px;
|
||||
border:0px;
|
||||
background-color: #fe9697;
|
||||
margin:9px 0 0 15px;
|
||||
border-radius:8px;
|
||||
padding:0px;
|
||||
outline:none;
|
||||
color:#fff;
|
||||
cursor: pointer;
|
||||
}
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 4.8 KiB |
@ -0,0 +1,62 @@
|
||||
$(function () {
|
||||
// 点击发送按钮将用户输入的内容显示
|
||||
$('#btnSend').on('click', function () {
|
||||
// trim方法用来清除字符串中两边的空格
|
||||
var text = $('#ipt').val().trim();
|
||||
// 判断用户输入的内容是否为空
|
||||
if (text.length <= 0) {
|
||||
return alert('请输入内容');
|
||||
}
|
||||
// 将用户输入的内容显示框当中
|
||||
$('#talk_list').append('<li class="right_word"><img src="img/person02.png" /> <span>' + text + '</span></li>');
|
||||
// 显示完成后需要将滚动条移动到显示框的最下面
|
||||
resetui();
|
||||
// 清空输入框里面的内容
|
||||
$('#ipt').val('');
|
||||
// 根据用户输入的内容反馈
|
||||
getMsg(text);
|
||||
})
|
||||
|
||||
// 根据用户输入的信息回馈内容
|
||||
function getMsg(text) {
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: 'http://www.liulongbin.top:3006/api/robot',
|
||||
data: {
|
||||
spoken: text
|
||||
},
|
||||
success: function (res) {
|
||||
// 当能够返回数据的时候需要将文字转换为语音
|
||||
if (res.message === 'success') {
|
||||
var msg = res.data.info.text;
|
||||
$('#talk_list').append('<li class="left_word"><img src="img/person01.png" /> <span>' + msg + '</span></li>')
|
||||
resetui();
|
||||
getVoice(msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 将机器人的文字转换为语音
|
||||
function getVoice(text) {
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: 'http://www.liulongbin.top:3006/api/synthesize',
|
||||
data: {
|
||||
text: text
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.status === 200) {
|
||||
$('#voice').attr('src', res.voiceUrl);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 绑定一个键盘事件,按回车键输出
|
||||
$('#ipt').on('keyup', function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
$('#btnSend').click();
|
||||
}
|
||||
})
|
||||
})
|
@ -0,0 +1,221 @@
|
||||
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Version: 3.1.12
|
||||
*
|
||||
* Requires: jQuery 1.2.2+
|
||||
*/
|
||||
|
||||
(function (factory) {
|
||||
if ( typeof define === 'function' && define.amd ) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node/CommonJS style for Browserify
|
||||
module.exports = factory;
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
|
||||
toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
|
||||
['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
|
||||
slice = Array.prototype.slice,
|
||||
nullLowestDeltaTimeout, lowestDelta;
|
||||
|
||||
if ( $.event.fixHooks ) {
|
||||
for ( var i = toFix.length; i; ) {
|
||||
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
|
||||
}
|
||||
}
|
||||
|
||||
var special = $.event.special.mousewheel = {
|
||||
version: '3.1.12',
|
||||
|
||||
setup: function() {
|
||||
if ( this.addEventListener ) {
|
||||
for ( var i = toBind.length; i; ) {
|
||||
this.addEventListener( toBind[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = handler;
|
||||
}
|
||||
// Store the line height and page height for this particular element
|
||||
$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
|
||||
$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if ( this.removeEventListener ) {
|
||||
for ( var i = toBind.length; i; ) {
|
||||
this.removeEventListener( toBind[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = null;
|
||||
}
|
||||
// Clean up the data we added to the element
|
||||
$.removeData(this, 'mousewheel-line-height');
|
||||
$.removeData(this, 'mousewheel-page-height');
|
||||
},
|
||||
|
||||
getLineHeight: function(elem) {
|
||||
var $elem = $(elem),
|
||||
$parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
|
||||
if (!$parent.length) {
|
||||
$parent = $('body');
|
||||
}
|
||||
return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
|
||||
},
|
||||
|
||||
getPageHeight: function(elem) {
|
||||
return $(elem).height();
|
||||
},
|
||||
|
||||
settings: {
|
||||
adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
|
||||
normalizeOffset: true // calls getBoundingClientRect for each event
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.extend({
|
||||
mousewheel: function(fn) {
|
||||
return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
|
||||
},
|
||||
|
||||
unmousewheel: function(fn) {
|
||||
return this.unbind('mousewheel', fn);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function handler(event) {
|
||||
var orgEvent = event || window.event,
|
||||
args = slice.call(arguments, 1),
|
||||
delta = 0,
|
||||
deltaX = 0,
|
||||
deltaY = 0,
|
||||
absDelta = 0,
|
||||
offsetX = 0,
|
||||
offsetY = 0;
|
||||
event = $.event.fix(orgEvent);
|
||||
event.type = 'mousewheel';
|
||||
|
||||
// Old school scrollwheel delta
|
||||
if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
|
||||
if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
|
||||
if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
|
||||
if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
|
||||
|
||||
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
|
||||
if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
|
||||
deltaX = deltaY * -1;
|
||||
deltaY = 0;
|
||||
}
|
||||
|
||||
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
|
||||
delta = deltaY === 0 ? deltaX : deltaY;
|
||||
|
||||
// New school wheel delta (wheel event)
|
||||
if ( 'deltaY' in orgEvent ) {
|
||||
deltaY = orgEvent.deltaY * -1;
|
||||
delta = deltaY;
|
||||
}
|
||||
if ( 'deltaX' in orgEvent ) {
|
||||
deltaX = orgEvent.deltaX;
|
||||
if ( deltaY === 0 ) { delta = deltaX * -1; }
|
||||
}
|
||||
|
||||
// No change actually happened, no reason to go any further
|
||||
if ( deltaY === 0 && deltaX === 0 ) { return; }
|
||||
|
||||
// Need to convert lines and pages to pixels if we aren't already in pixels
|
||||
// There are three delta modes:
|
||||
// * deltaMode 0 is by pixels, nothing to do
|
||||
// * deltaMode 1 is by lines
|
||||
// * deltaMode 2 is by pages
|
||||
if ( orgEvent.deltaMode === 1 ) {
|
||||
var lineHeight = $.data(this, 'mousewheel-line-height');
|
||||
delta *= lineHeight;
|
||||
deltaY *= lineHeight;
|
||||
deltaX *= lineHeight;
|
||||
} else if ( orgEvent.deltaMode === 2 ) {
|
||||
var pageHeight = $.data(this, 'mousewheel-page-height');
|
||||
delta *= pageHeight;
|
||||
deltaY *= pageHeight;
|
||||
deltaX *= pageHeight;
|
||||
}
|
||||
|
||||
// Store lowest absolute delta to normalize the delta values
|
||||
absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
|
||||
|
||||
if ( !lowestDelta || absDelta < lowestDelta ) {
|
||||
lowestDelta = absDelta;
|
||||
|
||||
// Adjust older deltas if necessary
|
||||
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
|
||||
lowestDelta /= 40;
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust older deltas if necessary
|
||||
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
|
||||
// Divide all the things by 40!
|
||||
delta /= 40;
|
||||
deltaX /= 40;
|
||||
deltaY /= 40;
|
||||
}
|
||||
|
||||
// Get a whole, normalized value for the deltas
|
||||
delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
|
||||
deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
|
||||
deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
|
||||
|
||||
// Normalise offsetX and offsetY properties
|
||||
if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
|
||||
var boundingRect = this.getBoundingClientRect();
|
||||
offsetX = event.clientX - boundingRect.left;
|
||||
offsetY = event.clientY - boundingRect.top;
|
||||
}
|
||||
|
||||
// Add information to the event object
|
||||
event.deltaX = deltaX;
|
||||
event.deltaY = deltaY;
|
||||
event.deltaFactor = lowestDelta;
|
||||
event.offsetX = offsetX;
|
||||
event.offsetY = offsetY;
|
||||
// Go ahead and set deltaMode to 0 since we converted to pixels
|
||||
// Although this is a little odd since we overwrite the deltaX/Y
|
||||
// properties with normalized deltas.
|
||||
event.deltaMode = 0;
|
||||
|
||||
// Add event and delta to the front of the arguments
|
||||
args.unshift(event, delta, deltaX, deltaY);
|
||||
|
||||
// Clearout lowestDelta after sometime to better
|
||||
// handle multiple device types that give different
|
||||
// a different lowestDelta
|
||||
// Ex: trackpad = 3 and mouse wheel = 120
|
||||
if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
|
||||
nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
|
||||
|
||||
return ($.event.dispatch || $.event.handle).apply(this, args);
|
||||
}
|
||||
|
||||
function nullLowestDelta() {
|
||||
lowestDelta = null;
|
||||
}
|
||||
|
||||
function shouldAdjustOldDeltas(orgEvent, absDelta) {
|
||||
// If this is an older event and the delta is divisable by 120,
|
||||
// then we are assuming that the browser is treating this as an
|
||||
// older mouse wheel event and that we should divide the deltas
|
||||
// by 40 to try and get a more usable deltaFactor.
|
||||
// Side note, this actually impacts the reported scroll distance
|
||||
// in older browsers and can cause scrolling to be slower than native.
|
||||
// Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
|
||||
return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
|
||||
}
|
||||
|
||||
}));
|
@ -0,0 +1,90 @@
|
||||
$(function () {
|
||||
var $main = $('.main');
|
||||
var $list = $('.talk_list');
|
||||
var $drager = $('.drager');
|
||||
var $mainh = $main.outerHeight(false);
|
||||
var $listh = $list.outerHeight(false);
|
||||
|
||||
var $rate = $mainh / $listh;
|
||||
var $dragh = $mainh * $rate;
|
||||
var $top = 0;
|
||||
$drager.css({ 'height': $dragh });
|
||||
|
||||
$drager.draggable({
|
||||
containment: "parent",
|
||||
drag: function (ev, ui) {
|
||||
$top = ui.position.top;
|
||||
$list.css({ 'top': -$top / $rate });
|
||||
}
|
||||
});
|
||||
|
||||
$(window).resize(function () {
|
||||
resetui();
|
||||
});
|
||||
|
||||
//var timer = null;
|
||||
var flag = false;
|
||||
|
||||
$main.mousewheel(function(ev,delta){
|
||||
//console.log(delta);
|
||||
//clearTimeout(timer);
|
||||
//timer = setTimeout(function(){
|
||||
// 向上滚动正值,向下滚动负值
|
||||
if(flag){
|
||||
return;
|
||||
}
|
||||
|
||||
flag = true;
|
||||
|
||||
setTimeout(function(){
|
||||
flag = false;
|
||||
},300);
|
||||
|
||||
if($listh <= $mainh){
|
||||
return;
|
||||
}else{
|
||||
if(delta>0){
|
||||
$top = $top-60;
|
||||
if($top<0){
|
||||
$top=0;
|
||||
}
|
||||
$drager.animate({ 'top': $top },200);
|
||||
$list.animate({ 'top': -$top / $rate },200);
|
||||
}else{
|
||||
$top = $top+60;
|
||||
if($top>($mainh-$dragh)){
|
||||
$top=parseInt($mainh-$dragh);
|
||||
}
|
||||
$drager.animate({ 'top': $top },200);
|
||||
$list.animate({ 'top': -parseInt($top / $rate) },200);
|
||||
}
|
||||
}
|
||||
|
||||
//},300);
|
||||
});
|
||||
if ($listh <= $mainh) {
|
||||
$('.drag_bar').hide();
|
||||
$('.drager').hide();
|
||||
}
|
||||
|
||||
function resetui(){
|
||||
$mainh = $main.outerHeight(false);
|
||||
$listh = $list.outerHeight(false);
|
||||
$rate = $mainh / $listh;
|
||||
$dragh = $mainh * $rate;
|
||||
$drager.css({ 'height': $dragh });
|
||||
|
||||
if ($listh <= $mainh) {
|
||||
$('.drag_bar').hide();
|
||||
$drager.hide();
|
||||
$list.css({ 'top':0 });
|
||||
} else {
|
||||
$('.drag_bar').show();
|
||||
$drager.show();
|
||||
$drager.css({ 'top': $mainh-$dragh });
|
||||
$list.css({ 'top': -($listh-$mainh) });
|
||||
}
|
||||
}
|
||||
|
||||
window.resetui = resetui;
|
||||
})
|
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<link rel="stylesheet" href="css/reset.css" />
|
||||
<link rel="stylesheet" href="css/main.css" />
|
||||
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
|
||||
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
|
||||
<script src="./js/scroll.js"></script>
|
||||
<script src="./js/index.js"></script>
|
||||
<title>聊天机器人</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<!-- 头部 Header 区域 -->
|
||||
<div class="header">
|
||||
<h3>小思同学</h3>
|
||||
<img src="img/person01.png" alt="icon" />
|
||||
</div>
|
||||
<!-- 中间 聊天内容区域 -->
|
||||
<div class="main">
|
||||
<ul class="talk_list" style="top: 0px;" id="talk_list">
|
||||
<li class="left_word">
|
||||
<img src="img/person01.png" /> <span>你好</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="drag_bar" style="display: none;">
|
||||
<div class="drager ui-draggable ui-draggable-handle" style="display: none; height: 412.628px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 底部 消息编辑区域 -->
|
||||
<div class="footer">
|
||||
<img src="img/person02.png" alt="icon" />
|
||||
<input type="text" placeholder="说的什么吧..." class="input_txt" id="ipt" />
|
||||
<input type="button" value="发 送" class="input_sub" id="btnSend" />
|
||||
</div>
|
||||
</div>
|
||||
<audio src="" autoplay id="voice" style="display: none"></audio>
|
||||
<script type="text/javascript" src="js/scroll.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
// 初始化右侧滚动条
|
||||
// 这个方法定义在scroll.js中
|
||||
resetui()
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,14 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
@ -0,0 +1 @@
|
||||
My Application
|
@ -0,0 +1,116 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<compositeConfiguration>
|
||||
<compositeBuild compositeDefinitionSource="SCRIPT" />
|
||||
</compositeConfiguration>
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8 (4)" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1 @@
|
||||
/build
|
@ -0,0 +1,29 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
buildToolsVersion "30.0.3"
|
||||
defaultConfig {
|
||||
applicationId "com.example.myapplication"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 28
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,27 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
|
||||
assertEquals("com.example.myapplication", appContext.getPackageName());
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.myapplication">
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-feature android:name="android.hardware.camera" android:required="true" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/tuer"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@drawable/tuer"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".Main6Activity"></activity>
|
||||
<activity android:name=".Main5Activity" />
|
||||
<activity android:name=".Main4Activity" />
|
||||
<activity android:name=".Main3Activity" />
|
||||
<activity
|
||||
android:name=".Main2Activity"
|
||||
android:launchMode="standard"
|
||||
android:theme="@style/Theme.AppCompat.NoActionBar" />
|
||||
<activity android:name=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
After Width: | Height: | Size: 27 KiB |
@ -0,0 +1,14 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class Main3Activity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main3);
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class Main5Activity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main5);
|
||||
}
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
|
||||
public class Main6Activity extends AppCompatActivity {
|
||||
String aa[]={
|
||||
"https://p0.ssl.qhimgs1.com/sdr/400__/t019a2ca151157d54f4.jpg",//总介绍
|
||||
"https://p0.ssl.qhimgs1.com/sdr/400__/t01dc64caa97b4ea060.jpg",//春节
|
||||
"https://p3.ssl.qhimgs1.com/sdr/400__/t0101cebef196addb13.jpg",//元宵
|
||||
"https://p3.ssl.qhimgs1.com/sdr/400__/t0194ad8e582bd2ead9.jpg",//社日
|
||||
"https://p2.ssl.qhimgs1.com/sdr/400__/t019883a0fef73d9688.jpg",//上巳
|
||||
"https://p2.ssl.qhimgs1.com/sdr/400__/t015827070899a5ccb8.jpg",//寒食
|
||||
"https://p0.ssl.qhimgs1.com/sdr/400__/t019f5b371e9f93d6f6.jpg",//清明
|
||||
"https://p0.ssl.qhimgs1.com/sdr/400__/t01b68641c7eb1de07e.jpg",//端午
|
||||
"https://p0.ssl.qhimgs1.com/sdr/400__/t01b98afbb36e3744e4.jpg",//七夕
|
||||
"https://p3.ssl.qhimgs1.com/sdr/400__/t0137f977dca7b74cb9.jpg",//中元
|
||||
"https://p0.ssl.qhimgs1.com/sdr/400__/t010ecaa09bf53c86b4.jpg",//中秋
|
||||
"https://p1.ssl.qhimgs1.com/sdr/400__/t01a053f5468593ff2b.jpg",//重阳
|
||||
"https://p0.ssl.qhimgs1.com/sdr/400__/t01e4189fdf23ee1774.jpg",//下元
|
||||
"https://p1.ssl.qhimgs1.com/sdr/400__/t01ccafe37d990a2661.jpg",//冬至
|
||||
"https://p1.ssl.qhimgs1.com/sdr/400__/t01e2184f2f7403227b.jpg",//除夕
|
||||
};
|
||||
String aaa;
|
||||
protected static final int CHANGE_UI = 1;
|
||||
protected static final int ERROR = 2;
|
||||
ImageView ima;
|
||||
TextView te;
|
||||
final Main6Activity thsa =this;
|
||||
private Handler handler = new Handler(){
|
||||
public void handleMessage(android.os.Message msg){
|
||||
if (msg.what == CHANGE_UI){
|
||||
Bitmap bitmap =(Bitmap) msg.obj;
|
||||
ima.setImageBitmap(bitmap);
|
||||
}else if(msg.what==ERROR){
|
||||
Toast.makeText(thsa,"显示图片错误",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main6);
|
||||
//te = (TextView)findViewById(R.id.tee);
|
||||
Intent intent = getIntent();
|
||||
long a = intent.getLongExtra("name",99);
|
||||
int b =(int)a;
|
||||
switch (b){
|
||||
case 0:aaa=aa[0];break;
|
||||
case 1:aaa=aa[1];break;
|
||||
case 2:aaa=aa[2];break;
|
||||
case 3:aaa=aa[3];break;
|
||||
case 4:aaa=aa[4];break;
|
||||
case 5:aaa=aa[5];break;
|
||||
case 6:aaa=aa[6];break;
|
||||
case 7:aaa=aa[7];break;
|
||||
case 8:aaa=aa[8];break;
|
||||
case 9:aaa=aa[9];break;
|
||||
case 10:aaa=aa[10];break;
|
||||
case 11:aaa=aa[11];break;
|
||||
case 12:aaa=aa[12];break;
|
||||
case 13:aaa=aa[13];break;
|
||||
case 14:aaa=aa[14];break;
|
||||
case 15:aaa=aa[15];break;
|
||||
|
||||
}
|
||||
String shuzi=String.valueOf(b);
|
||||
//te.setText(shuzi);
|
||||
ima = (ImageView)findViewById(R.id.image);
|
||||
if(TextUtils.isEmpty(aaa)){
|
||||
Toast.makeText(this,"图片路径不能为空",Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
new Thread(){
|
||||
private HttpURLConnection conn;
|
||||
private Bitmap bitmap;
|
||||
public void run(){
|
||||
try{
|
||||
URL uri = new URL(aaa);
|
||||
conn = (HttpURLConnection) uri.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
conn.setConnectTimeout(5000);
|
||||
int code =conn.getResponseCode();
|
||||
if(code == 200){
|
||||
InputStream is = conn.getInputStream();
|
||||
bitmap = BitmapFactory.decodeStream(is);
|
||||
Message msg = new Message();
|
||||
msg.what=CHANGE_UI;
|
||||
msg.obj=bitmap;
|
||||
handler.sendMessage(msg);
|
||||
}else{
|
||||
Message msg =new Message();
|
||||
msg.what=ERROR;
|
||||
handler.sendMessage(msg);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Message msg = new Message();
|
||||
msg.what = ERROR;
|
||||
handler.sendMessage(msg);
|
||||
}
|
||||
conn.disconnect();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
((Button) findViewById(R.id.gai)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) { // 请求拍照
|
||||
dispatchTakePictureIntent();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static final int REQUEST_IMAGE_CAPTURE = 1;
|
||||
|
||||
// 请求拍照
|
||||
private void dispatchTakePictureIntent() {
|
||||
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
|
||||
startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
//super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();
|
||||
Bitmap imageBitmap = (Bitmap) extras.get("data");
|
||||
ima.setImageBitmap(imageBitmap);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Button btnOpen = (Button) findViewById(R.id.button4);
|
||||
|
||||
View view = findViewById(R.id.button4);
|
||||
final MainActivity thisActivity = this;
|
||||
btnOpen.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(thisActivity, Main2Activity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.example.myapplication;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.location.Criteria;
|
||||
import android.location.Location;
|
||||
import android.location.LocationListener;
|
||||
import android.location.LocationManager;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
@ -0,0 +1,86 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import android.util.Xml;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class jierihuochu{
|
||||
static List<jieriInfo> getInfofosfrom(InputStream is)throws Exception{
|
||||
XmlPullParser parser = Xml.newPullParser();
|
||||
parser.setInput(is,"utf-8");
|
||||
List<jieriInfo> jieriInfos = null;
|
||||
jieriInfo jieriinfo = null;
|
||||
int type = parser.getEventType();
|
||||
while (type!= XmlPullParser.END_DOCUMENT){
|
||||
switch (type){
|
||||
case XmlPullParser.START_TAG:
|
||||
if("infos".equals(parser.getName())){
|
||||
jieriInfos = new ArrayList<jieriInfo>();
|
||||
}else if("jieri".equals(parser.getName())){
|
||||
jieriinfo = new jieriInfo();
|
||||
String ids = parser.getAttributeValue(0);
|
||||
jieriinfo.setid(ids);
|
||||
}else if("temp".equals(parser.getName())){
|
||||
String temp = parser.nextText();
|
||||
assert jieriinfo != null;
|
||||
jieriinfo.settemp(temp);
|
||||
}
|
||||
else if("shijian".equals(parser.getName())){
|
||||
String shijian = parser.nextText();
|
||||
assert jieriinfo != null;
|
||||
jieriinfo.setshijian(shijian);
|
||||
}
|
||||
else if("huodong".equals(parser.getName())){
|
||||
String huodong = parser.nextText();
|
||||
assert jieriinfo != null;
|
||||
jieriinfo.sethuodong(huodong);
|
||||
}
|
||||
break;
|
||||
case XmlPullParser.END_TAG:
|
||||
if("jieri".equals(parser.getName())){
|
||||
assert jieriInfos != null;
|
||||
jieriInfos.add(jieriinfo);
|
||||
jieriinfo = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
type = parser.next();
|
||||
}
|
||||
return jieriInfos;
|
||||
}
|
||||
}
|
||||
|
||||
class jieriInfo{
|
||||
private String id;
|
||||
private String temp;
|
||||
private String shijian;
|
||||
private String huodong;
|
||||
public String getid(){
|
||||
return id;
|
||||
}
|
||||
void setid(String id){
|
||||
this.id = id;
|
||||
}
|
||||
String gettemp(){
|
||||
return temp;
|
||||
}
|
||||
void settemp(String temp){
|
||||
this.temp = temp;
|
||||
}
|
||||
String getshijian(){
|
||||
return shijian;
|
||||
}
|
||||
void setshijian(String shijian){
|
||||
this.shijian = shijian;
|
||||
}
|
||||
String gethuodong(){
|
||||
return huodong;
|
||||
}
|
||||
void sethuodong(String huodong){
|
||||
this.huodong = huodong;
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.example.myapplication;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.view.View;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
class Save{
|
||||
public static boolean saveInfo(Context context,String shijian,String riqi,int q){
|
||||
SharedPreferences sp = context.getSharedPreferences("date",Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
String s=String.valueOf(q);
|
||||
editor.putString(s+"shijian",shijian);
|
||||
editor.putString(s+"shijian2",riqi);
|
||||
editor.putInt("a",q);
|
||||
editor.commit();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Map<String,String> getInfo(Context context, String shijian){
|
||||
SharedPreferences sp = context.getSharedPreferences("date",Context.MODE_PRIVATE);
|
||||
String shijian1 = sp.getString(shijian+"shijian",null);
|
||||
String riqi1 = sp.getString(shijian+"shijian2",null);
|
||||
Map<String,String> usermap = new HashMap<String, String>();
|
||||
usermap.put("shijian1",shijian1);
|
||||
usermap.put("riqi1",riqi1);
|
||||
return usermap;
|
||||
}
|
||||
}
|
||||
|
||||
class Saveri{
|
||||
public static boolean saveInfori(Context context,String shijian,String riqi,int q){
|
||||
SharedPreferences dp = context.getSharedPreferences("jieri",Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = dp.edit();
|
||||
String s=String.valueOf(q);
|
||||
editor.putString(s+"shijian",shijian);
|
||||
editor.putString(s+"shijian2",riqi);
|
||||
editor.putInt("a",q);
|
||||
editor.commit();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Map<String,String> getInfori(Context context, String shijian){
|
||||
SharedPreferences dp = context.getSharedPreferences("jieri",Context.MODE_PRIVATE);
|
||||
String shijian1 = dp.getString(shijian+"shijian",null);
|
||||
String riqi1 = dp.getString(shijian+"shijian2",null);
|
||||
Map<String,String> usermap = new HashMap<String, String>();
|
||||
usermap.put("shijian1",shijian1);
|
||||
usermap.put("riqi1",riqi1);
|
||||
return usermap;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="59.01639"
|
||||
android:viewportHeight="59.01639">
|
||||
<group android:translateX="-24.491804"
|
||||
android:translateY="-24.491804">
|
||||
<path
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="78.5885"
|
||||
android:endY="90.9159"
|
||||
android:startX="48.7653"
|
||||
android:startY="61.0927"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1" />
|
||||
</group>
|
||||
</vector>
|
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#FFFFFF"/>
|
||||
<corners android:radius="100dp"/>
|
||||
|
||||
</shape>
|
After Width: | Height: | Size: 267 B |
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#008577"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
After Width: | Height: | Size: 133 B |
After Width: | Height: | Size: 167 B |
After Width: | Height: | Size: 182 B |
After Width: | Height: | Size: 375 B |
After Width: | Height: | Size: 367 B |
After Width: | Height: | Size: 303 B |
After Width: | Height: | Size: 318 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 330 B |
After Width: | Height: | Size: 375 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 84 KiB |
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#30A0FF99"/>
|
||||
<corners android:radius="20dp"/>
|
||||
</shape>
|
After Width: | Height: | Size: 588 B |
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#70A0FF99"/>
|
||||
<corners android:radius="20dp"/>
|
||||
</shape>
|
After Width: | Height: | Size: 803 B |
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#80A0FF99"/>
|
||||
<corners android:radius="360dip"/>
|
||||
<padding
|
||||
android:left="10dp"
|
||||
android:top="10dp"
|
||||
android:right="10dp"
|
||||
android:bottom="10dp"/>
|
||||
|
||||
</shape>
|
After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#6A000000"/>
|
||||
</shape>
|
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/ad"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button4"
|
||||
android:layout_width="400dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.5"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="@string/jiemian11"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:layout_editor_absoluteY="28dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/days_matter"
|
||||
android:layout_marginTop="100dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.21" />
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/background_light"
|
||||
tools:context=".Main2Activity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="提示 >"
|
||||
android:textSize="25sp"
|
||||
android:textColor="#000000"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="220dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:alpha="0.8"
|
||||
android:src="@drawable/jiahao"
|
||||
android:background="@drawable/button_shape" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:src="@drawable/gengdu"
|
||||
android:alpha="0.8"
|
||||
android:background="@drawable/button_shape"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/shang">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/Lin1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/Lin2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="190dp"
|
||||
android:background="@drawable/tishi"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/zhuxianshi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="程序只显示事件倒数日前10天"
|
||||
android:textColor="#000000"
|
||||
android:textSize="25sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/jia"
|
||||
android:textColor="#000000"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/dian"
|
||||
android:textColor="#000000"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/Botton10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="300dp"
|
||||
android:background="@drawable/tuoyuan"
|
||||
android:text="关闭" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="待办事件:"
|
||||
android:textColor="#54000000"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textSize="25sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/shijianbiao"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:id="@+id/biaox1"
|
||||
android:padding="10.0dip">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/s10"
|
||||
android:layout_marginTop="5dp"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:id="@+id/neix1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/duan"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="当前时间"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#000000"
|
||||
android:layout_marginLeft="20dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/duan2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:textSize="20sp"
|
||||
android:text="2021年6月14日"
|
||||
android:textColor="#FFAB00"/>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="400dp"
|
||||
android:layout_below="@+id/neix1"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/xiahua1"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="特殊日子:"
|
||||
android:textColor="#54000000"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textSize="25sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/riqibiao"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Main3Activity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/baise"
|
||||
tools:context=".Main4Activity">
|
||||
<ImageView
|
||||
android:id="@+id/iv"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="40dp"
|
||||
android:background="@drawable/shijian"/>
|
||||
<RadioGroup
|
||||
android:id="@+id/aa"
|
||||
android:layout_below="@+id/iv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:orientation="horizontal">
|
||||
<RadioButton
|
||||
android:id="@+id/qq"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="特殊事件:"/>
|
||||
<RadioButton
|
||||
android:id="@+id/ww"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="节假日:"/>
|
||||
</RadioGroup>
|
||||
<LinearLayout
|
||||
android:id="@+id/qw"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/aa"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="#ffffff">
|
||||
<TextView
|
||||
android:id="@+id/pp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:text="事件内容"
|
||||
android:textColor="#000"
|
||||
android:textSize="20sp"/>
|
||||
<EditText
|
||||
android:id="@+id/wen1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:padding="10dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/er"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/qw"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="#ffffff">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/we"
|
||||
android:padding="10dp"
|
||||
android:text="设置日期"
|
||||
android:textColor="#000"
|
||||
android:textSize="20sp"/>
|
||||
<Button
|
||||
android:id="@+id/btn_Date"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="日期" />
|
||||
<Button
|
||||
android:id="@+id/btn_Time"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="时间" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/wan"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/er"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="@drawable/tuoyuan"
|
||||
android:text="完成"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#000000"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtDate"
|
||||
android:gravity="center"
|
||||
android:textSize="15sp"
|
||||
android:layout_below="@+id/wan"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/txtTime"
|
||||
android:gravity="center"
|
||||
android:layout_below="@id/txtDate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Main5Activity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".Main6Activity">
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/gai"
|
||||
android:text="拍照更改图片"/>
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"/>
|
||||
</LinearLayout>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_x="50dp"
|
||||
android:layout_y="50dp"
|
||||
android:text="Button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_x="164dp"
|
||||
android:layout_y="139dp"
|
||||
android:text="Button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_x="282dp"
|
||||
android:layout_y="219dp"
|
||||
android:text="Button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_x="171dp"
|
||||
android:layout_y="300dp"
|
||||
android:text="Button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_x="63dp"
|
||||
android:layout_y="379dp"
|
||||
android:text="Button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_x="173dp"
|
||||
android:layout_y="463dp"
|
||||
android:text="Button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_x="284dp"
|
||||
android:layout_y="535dp"
|
||||
android:text="Button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_x="183dp"
|
||||
android:layout_y="632dp"
|
||||
android:text="Button" />
|
||||
|
||||
</AbsoluteLayout>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</TextView>
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtext"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textColor="#CB000000"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/layout_myview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/formcustomspinner_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp"
|
||||
android:layout_weight="1"
|
||||
android:cacheColorHint="@null"
|
||||
android:background="#7FFFD4"
|
||||
android:divider="@android:drawable/divider_horizontal_bright"
|
||||
android:scrollbars="none" /> <!-- listview 的线为灰色 -->
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<infos>
|
||||
<jieri id="端午">
|
||||
<temp>农历</temp>
|
||||
<shijian>每年5月1号</shijian>
|
||||
<huodong>包粽子,登山,划龙舟</huodong>
|
||||
</jieri>
|
||||
<jieri id="儿童">
|
||||
<temp>新历</temp>
|
||||
<shijian>每年6月1号</shijian>
|
||||
<huodong>送礼物,吃糖果,移动开发</huodong>
|
||||
</jieri>
|
||||
<jieri id="新年">
|
||||
<temp>农历</temp>
|
||||
<shijian>每年1月1号</shijian>
|
||||
<huodong>探亲戚,包红包,团圆饭</huodong>
|
||||
</jieri>
|
||||
<jieri id="国庆节">
|
||||
<temp>农历</temp>
|
||||
<shijian>每年10月1号</shijian>
|
||||
<huodong>放假七天</huodong>
|
||||
</jieri>
|
||||
</infos>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#008577</color>
|
||||
<color name="colorPrimaryDark">#00574B</color>
|
||||
<color name="colorAccent">#D81B60</color>
|
||||
</resources>
|
@ -0,0 +1,10 @@
|
||||
<resources>
|
||||
<string name="app_name">倒数日</string>
|
||||
<string name="jiemian11">进入主页-倒数日</string>
|
||||
<string name="days_matter">「倒数日 · Days Matter」是一个帮你记录生活中重要日子的小工具</string>
|
||||
<string name="a">记录特殊事件</string>
|
||||
<string name="b">计算日期</string>
|
||||
<string name="c">标志节假日</string>
|
||||
<string name="jia">"+" :可以添加事件,如特色日期、节假日</string>
|
||||
<string name="dian">"..." :可以显示所有的事件,包含正在进行、已过期</string>
|
||||
</resources>
|
@ -0,0 +1,11 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -0,0 +1,17 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.1'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=true
|
||||
|
@ -0,0 +1,6 @@
|
||||
#Sun Apr 18 20:58:51 CST 2021
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
@ -0,0 +1,172 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
@ -0,0 +1,84 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
@ -0,0 +1,2 @@
|
||||
include ':app'
|
||||
rootProject.name='My Application'
|