体系结构

master
hfl 4 years ago
parent 8973396996
commit 8124eb1399

@ -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;
}

@ -0,0 +1,36 @@
body,ul,h1,h2,h3,h4,h5,h6{
margin: 0;
padding: 0;
}
h1,h2,h3,h4,h5,h6{
font-size:100%;
font-weight:normal;
}
a{
text-decoration:none;
}
ul{
list-style:none;
}
img{
border:0px;
}
/* 清除浮动解决margin-top塌陷 */
.clearfix:before,.clearfix:after{
content:'';
display:table;
}
.clearfix:after{
clear:both;
}
.clearfix{
zoom:1;
}
.fl{
float:left;
}
.fr{
float:right;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

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();
}
})
})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -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,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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

@ -0,0 +1,505 @@
package com.example.myapplication;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.res.ResourcesCompat;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.ResourceCursorAdapter;
import android.widget.TextView;
import android.widget.Toast;
import java.io.InputStream;
import java.nio.FloatBuffer;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.example.myapplication.R.id.button9;
import static com.example.myapplication.R.id.content;
import static com.example.myapplication.R.id.default_activity_button;
public class Main2Activity extends AppCompatActivity {
private List<String> list1 = new ArrayList<String>();
private AlertDialog.Builder builder;
private AlertDialog alertDialog;
private LinearLayout shijianbiao;
private LinearLayout riqibiao;
TextView T1;
TextView T2;
private int a=0;
private int num= 0;
private String temp,shijian,huogdong;
private List<Map<String,String>> list;
private Map<String,String> map;
private String[] shijia = {
"英语课","电脑课"
};
Main2Activity thisActivity;
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
list1 = initData();
thisActivity = this;
// ArrayAdapter<String> ad=new ArrayAdapter<String>(Main2Activity.this,R.layout.layout2,shijian);
// ListView list =(ListView)findViewById(R.id.li);
// list.setAdapter(ad);
Button Bu10 =(Button)findViewById(R.id.Botton10);
final LinearLayout LinL1 =(LinearLayout) findViewById(R.id.Lin1);
final LinearLayout LinL2 =(LinearLayout) findViewById(R.id.Lin2);
shijianbiao =(LinearLayout) findViewById(R.id.shijianbiao);
riqibiao =(LinearLayout) findViewById(R.id.riqibiao);
riqibiao =(LinearLayout) findViewById(R.id.riqibiao);
Bu10.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LinL1.removeView(LinL2);
}
});
ImageButton Bu9 = (ImageButton) findViewById(R.id.button9);
Bu9.setOnClickListener(new View.OnClickListener() {
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onClick(View view) {
Intent intent2 = new Intent(thisActivity,Main4Activity.class);
startActivity(intent2);
}
});
final TextView duan = (TextView) findViewById(R.id.duan);
final TextView duan2 = (TextView) findViewById(R.id.duan2);
try{
InputStream is = this.getResources().openRawResource(R.raw.jieri);
List<jieriInfo> jieriInfos = jierihuochu.getInfofosfrom(is);
list = new ArrayList<Map<String, String>>();
for(jieriInfo info:jieriInfos){
map = new HashMap<String, String>();
map.put("temp",info.gettemp());
map.put("shijian",info.getshijian());
map.put("huodong",info.gethuodong());
list.add(map);
}
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(this,"解析失败",Toast.LENGTH_SHORT).show();
}
ImageButton Bu11 = (ImageButton) findViewById(R.id.button10);
Bu11.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// int chang = list.size();
// if(num==chang)num=0;
// Map<String,String> jieriMap = list.get(num);
// temp = jieriMap.get("temp");
// shijian = jieriMap.get("shijian");
// huogdong = jieriMap.get("huodong");
// duan.setText(temp);
// duan2.setText(huogdong);
// num=num+1;
//Map<String,String> user = Save.getInfo(thisActivity,"guijie");
//if(user!=null){
// duan.setText(user.get("shijian1"));
// duan2.setText(user.get("riqi1"));
// SharedPreferences sp = getSharedPreferences("date",Context.MODE_PRIVATE);
// SharedPreferences.Editor editor = sp.edit();
// editor.clear();
//}
//Intent intent3 = new Intent(thisActivity,Main5Activity.class);
//startActivity(intent3);
ShowDialog();//弹框操作
}
});
SharedPreferences sp = getSharedPreferences("date", Context.MODE_PRIVATE);
int b = sp.getInt("a",0);
if(b!=0){
for(int i=1;i<=b;i++){
String shuzi=String.valueOf(i);
Map<String,String> user = Save.getInfo(this,shuzi);
String daoshu = user.get("riqi1");
String aa = gettime();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年M月d日");// 输入日期的格式
Date date1 = null;
try {
date1 = simpleDateFormat.parse(daoshu);
} catch (ParseException e) {
e.printStackTrace();
}
Date date2 = null;
try {
date2 = simpleDateFormat.parse(aa);
} catch (ParseException e) {
e.printStackTrace();
}
GregorianCalendar cal1 = new GregorianCalendar();
GregorianCalendar cal2 = new GregorianCalendar();
cal1.setTime(date1);
cal2.setTime(date2);
double dayCount = (cal1.getTimeInMillis() - cal2.getTimeInMillis()) / (1000 * 3600 * 24);// 从间隔毫秒变成间隔天数
int trainDay = (int) dayCount;
if(trainDay>=10||trainDay<0)continue;
jiashi(shuzi,trainDay);
}
}
SharedPreferences dp = getSharedPreferences("jieri", Context.MODE_PRIVATE);
int c = dp.getInt("a",0);
String s=String.valueOf(c);
Toast.makeText(this,s,Toast.LENGTH_SHORT).show();
if(c!=0){
for(int i=1;i<=c;i++){
String shuzi=String.valueOf(i);
Map<String,String> user = Saveri.getInfori(this,shuzi);
String daoshu = user.get("riqi1");
String aa = gettime();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年M月d日");// 输入日期的格式
Date date1 = null;
try {
date1 = simpleDateFormat.parse(daoshu);
} catch (ParseException e) {
e.printStackTrace();
}
Date date2 = null;
try {
date2 = simpleDateFormat.parse(aa);
} catch (ParseException e) {
e.printStackTrace();
}
GregorianCalendar cal1 = new GregorianCalendar();
GregorianCalendar cal2 = new GregorianCalendar();
cal1.setTime(date1);
cal2.setTime(date2);
double dayCount = (cal1.getTimeInMillis() - cal2.getTimeInMillis()) / (1000 * 3600 * 24);// 从间隔毫秒变成间隔天数
int trainDay = (int) dayCount;
if(trainDay>=10||trainDay<0)continue;
jiari(shuzi,trainDay);
}
}
String aaa = gettime();
duan2.setText(aaa);
//Intent intent2 = getIntent();
//String neirong = intent2.getStringExtra("neirong");
//String shiqi = intent2.getStringExtra("shiqi");
//a =intent2.getIntExtra("shu",0);
//TextView duan = (TextView) findViewById(R.id.duan);
//TextView duan2 = (TextView) findViewById(R.id.duan2);
//duan.setText(neirong);
//duan2.setText(shiqi);
}
private ArrayList<String> initData() {
ArrayList<String> list = new ArrayList<String>();
String name1="中国传统节日24节气";
String name2="春节";
String name3="元宵节";
String name4="社日节";
String name5="上巳节";
String name6="寒食节";
String name7="清明节";
String name8="端午节";
String name9="七夕节";
String name10="中元节";
String name11="中秋节";
String name12="重阳节";
String name13="下元节";
String name14="冬至节";
String name15="除夕";
list.add(name1);
list.add(name2);
list.add(name3);
list.add(name4);
list.add(name5);
list.add(name6);
list.add(name7);
list.add(name8);
list.add(name9);
list.add(name10);
list.add(name11);
list.add(name12);
list.add(name13);
list.add(name14);
list.add(name15);
return list;
}
public void ShowDialog() {
Context context = Main2Activity.this;
LayoutInflater inflater = (LayoutInflater) context.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.list_tx_picture, null);
ListView myListView = (ListView) layout.findViewById(R.id.formcustomspinner_list);
MyAdapter adapter = new MyAdapter(context, list1);
myListView.setAdapter(adapter);
myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int positon, long id) {
//在这里面就是执行点击后要进行的操作,这里只是做一个显示
//if (alertDialog != null) {
// alertDialog.dismiss();
//}
Intent intent = new Intent(thisActivity, Main6Activity.class);
intent.putExtra("name",id);
startActivity(intent);
}
});
builder = new AlertDialog.Builder(context);
builder.setView(layout);
alertDialog = builder.create();
alertDialog.show();
}
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
public void jiashi(String str,int day){
//final Button buttona =new Button(this);
//buttona.setBackgroundColor(Color.argb(255,162,205,90));
//buttona.setText("asdadaadawsda");
Map<String,String> user = Save.getInfo(this,str);
String daoshu = user.get("riqi1");
//char e = daoshu.charAt(8);
String s =String.valueOf(day);
char e = s.charAt(0);
RelativeLayout r1 =new RelativeLayout(this);
LinearLayout.LayoutParams lRelativeLayout =new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
lRelativeLayout.setMargins(0,5,0,0);
r1.setLayoutParams(lRelativeLayout);
//r1.setBackgroundColor(Color.argb(255, 162, 205, 90)); // #FFA2CD5A
r1.setPadding(0,10,0,0);
ImageView Im1 = new ImageView(this);
Drawable d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s10,null);
switch (e){
case '1':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s1,null);break;
case '2':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s2,null);break;
case '3':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s3,null);break;
case '4':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s4,null);break;
case '5':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s5,null);break;
case '6':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s6,null);break;
case '7':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s7,null);break;
case '8':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s8,null);break;
case '9':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s9,null);break;
}
Im1.setBackground(d1);
LinearLayout.LayoutParams im1 =new LinearLayout.LayoutParams(80,80);
im1.setMargins(20,30,0,0);
Im1.setLayoutParams(im1);
r1.addView(Im1);
LinearLayout layou = new LinearLayout(this);
LinearLayout.LayoutParams lRelativeLayou =new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
lRelativeLayou.setMargins(150,0,0,0);
layou.setLayoutParams(lRelativeLayou);
layou.setOrientation(LinearLayout.VERTICAL);
TextView T1 = new TextView(this);
LinearLayout.LayoutParams lRelativeLayou2 =new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
lRelativeLayou2.setMargins(20,0,0,0);
T1.setLayoutParams(lRelativeLayou2);
T1.setTextSize(18);
T1.setTextColor(Color.parseColor("#000000"));
T1.setText(user.get("shijian1"));
layou.addView(T1);
TextView T2 = new TextView(this);
LinearLayout.LayoutParams lRelativeLayou3 =new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
lRelativeLayou2.setMargins(20,20,0,0);
T2.setLayoutParams(lRelativeLayou2);
T2.setTextSize(20);
T2.setTextColor(Color.parseColor("#FFAB00"));
T2.setText(user.get("riqi1"));
layou.addView(T2);
r1.addView(layou);
ImageView Im2 = new ImageView(this);
Drawable d2 = ResourcesCompat.getDrawable(getResources(),R.drawable.xiahua1,null);
Im2.setBackground(d2);
LinearLayout.LayoutParams im2 =new LinearLayout.LayoutParams(1020,5);
im2.setMargins(30,30,0,0);
Im2.setLayoutParams(im2);
shijianbiao.addView(r1);
shijianbiao.addView(Im2);
}
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
public void jiari(String str,int day){
//final Button buttona =new Button(this);
//buttona.setBackgroundColor(Color.argb(255,162,205,90));
//buttona.setText("asdadaadawsda");
Map<String,String> user = Saveri.getInfori(this,str);
String daoshu = user.get("riqi1");
//char e = daoshu.charAt(8);
String s =String.valueOf(day);
char e = s.charAt(0);
RelativeLayout r1 =new RelativeLayout(this);
LinearLayout.LayoutParams lRelativeLayout =new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
lRelativeLayout.setMargins(0,5,0,0);
r1.setLayoutParams(lRelativeLayout);
//r1.setBackgroundColor(Color.argb(255, 162, 205, 90)); // #FFA2CD5A
r1.setPadding(0,10,0,0);
ImageView Im1 = new ImageView(this);
Drawable d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s10,null);
switch (e){
case '1':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s1,null);break;
case '2':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s2,null);break;
case '3':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s3,null);break;
case '4':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s4,null);break;
case '5':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s5,null);break;
case '6':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s6,null);break;
case '7':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s7,null);break;
case '8':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s8,null);break;
case '9':d1 = ResourcesCompat.getDrawable(getResources(),R.drawable.s9,null);break;
}
Im1.setBackground(d1);
LinearLayout.LayoutParams im1 =new LinearLayout.LayoutParams(80,80);
im1.setMargins(30,20,0,0);
Im1.setLayoutParams(im1);
r1.addView(Im1);
LinearLayout layou = new LinearLayout(this);
LinearLayout.LayoutParams lRelativeLayou =new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
lRelativeLayou.setMargins(130,0,0,0);
layou.setLayoutParams(lRelativeLayou);
layou.setOrientation(LinearLayout.HORIZONTAL);
TextView T1 = new TextView(this);
LinearLayout.LayoutParams lRelativeLayou2 =new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
lRelativeLayou2.setMargins(15,0,0,0);
T1.setLayoutParams(lRelativeLayou2);
T1.setTextSize(30);
T1.setTextColor(Color.parseColor("#000000"));
T1.setText(user.get("shijian1"));
layou.addView(T1);
TextView T2 = new TextView(this);
LinearLayout.LayoutParams lRelativeLayou3 =new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
lRelativeLayou2.setMargins(40,20,0,0);
T2.setLayoutParams(lRelativeLayou2);
T2.setTextSize(20);
T2.setTextColor(Color.parseColor("#FFAB00"));
T2.setText(user.get("riqi1"));
layou.addView(T2);
r1.addView(layou);
ImageView Im2 = new ImageView(this);
Drawable d2 = ResourcesCompat.getDrawable(getResources(),R.drawable.xiahua1,null);
Im2.setBackground(d2);
LinearLayout.LayoutParams im2 =new LinearLayout.LayoutParams(1020,5);
im2.setMargins(30,30,0,0);
Im2.setLayoutParams(im2);
riqibiao.addView(r1);
riqibiao.addView(Im2);
}
private String gettime(){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年M月d日 H时m分");
Date date = new Date(System.currentTimeMillis());
String time = simpleDateFormat.format(date);
return time;
}
}
class MyAdapter extends BaseAdapter {
private List<String> mlist;
private Context mContext;
public MyAdapter(Context context, List<String> list) {
this.mContext = context;
mlist = new ArrayList<String>();
this.mlist = list;
}
@Override
public int getCount() {
return mlist.size();
}
@Override
public Object getItem(int position) {
return mlist.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Person person = null;
if (convertView == null) {
LayoutInflater inflater = LayoutInflater.from(mContext);
convertView = inflater.inflate(R.layout.list_tx_item,null);
person = new Person();
person.name = (TextView)convertView.findViewById(R.id.txtext);
convertView.setTag(person);
}else{
person = (Person)convertView.getTag();
}
person.name.setText(mlist.get(position).toString());
return convertView;
}
class Person{
TextView name;
}
}

@ -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,202 @@
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Locale;
import static com.example.myapplication.R.id.aa;
import static com.example.myapplication.R.id.btn_Time;
import static com.example.myapplication.R.id.wen1;
public class Main4Activity extends AppCompatActivity implements View.OnClickListener{
private EditText wen1;
private EditText wen2;
private int a=1;
private LinearLayout er;
private TextView txtDate;
private TextView txtTime;
private Button btnDate;
private Button btnTime;
DateFormat format = DateFormat.getDateTimeInstance();
Calendar calendar = Calendar.getInstance(Locale.CHINA);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main4);
final Main4Activity thisactivity = this;
er =(LinearLayout)findViewById(R.id.er);
wen1 = (EditText)findViewById(R.id.wen1);
//wen2 = (EditText)findViewById(R.id.wen2);
RadioGroup RR =(RadioGroup) findViewById(R.id.aa);
final TextView pw =(TextView)findViewById(R.id.pp);
btnDate = (Button) findViewById(R.id.btn_Date);
btnTime = (Button) findViewById(btn_Time);
txtDate = (TextView) findViewById(R.id.txtDate);
txtTime = (TextView) findViewById(R.id.txtTime);
btnDate.setOnClickListener(this);
btnTime.setOnClickListener(this);
RR.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
if (i==R.id.ww){
a=2;
pw.setText("节假日:");
er.removeView(btnTime);
LinearLayout.LayoutParams btndate =new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
btndate.setMargins(0,5,0,0);
btnDate.setLayoutParams(btndate);
}
if (i==R.id.qq){
a=1;
pw.setText("特殊事件:");
}
}
});
Button wancheng=(Button) findViewById(R.id.wan);
wancheng.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(a==1) passDate();
if(a==2)passJieri();
}
});
}
public void passDate(){
String shijian =wen1.getText().toString().trim();
String date1 = txtDate.getText().toString().trim();
String date2 = txtTime.getText().toString().trim();
String riqi =date1+" "+date2;
if(TextUtils.isEmpty(shijian)){
Toast.makeText(this,"请输入对应事件",Toast.LENGTH_SHORT).show();
return;
}
if(TextUtils.isEmpty(date1)){
Toast.makeText(this,"请输入对应日期",Toast.LENGTH_SHORT).show();
return;
}
if(TextUtils.isEmpty(date2)){
Toast.makeText(this,"请输入对应时间",Toast.LENGTH_SHORT).show();
return;
}
SharedPreferences sp = getSharedPreferences("date", Context.MODE_PRIVATE);
int b = sp.getInt("a",0);
b=b+1;
boolean issave = Save.saveInfo(this,shijian,riqi,b);
if(issave){
Toast.makeText(this,"保存成功",Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(this,"保存失败",Toast.LENGTH_SHORT).show();
}
Intent intent4 =new Intent(this,Main2Activity.class);
//intent4.putExtra("neirong",wen1.getText().toString().trim());
//intent4.putExtra("shiqi",wen2.getText().toString().trim());
//intent4.putExtra("shu",a);
startActivity(intent4);
}
public void passJieri(){
String shijian =wen1.getText().toString().trim();
String date1 = txtDate.getText().toString().trim();
String riqi =date1;
if(TextUtils.isEmpty(shijian)){
Toast.makeText(this,"请输入对应事件",Toast.LENGTH_SHORT).show();
return;
}
if(TextUtils.isEmpty(date1)){
Toast.makeText(this,"请输入对应日期",Toast.LENGTH_SHORT).show();
return;
}
SharedPreferences dp = getSharedPreferences("jieri", Context.MODE_PRIVATE);
int b = dp.getInt("a",0);
b=b+1;
boolean issave = Saveri.saveInfori(this,shijian,riqi,b);
if(issave){
Toast.makeText(this,"保存成功",Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(this,"保存失败",Toast.LENGTH_SHORT).show();
}
Intent intent4 =new Intent(this,Main2Activity.class);
//intent4.putExtra("neirong",wen1.getText().toString().trim());
//intent4.putExtra("shiqi",wen2.getText().toString().trim());
//intent4.putExtra("shu",a);
startActivity(intent4);
}
public static void showDatePickerDialog(Activity activity, int themeResId, final TextView tv, Calendar calendar) {
// 直接创建一个DatePickerDialog对话框实例并将它显示出来
new DatePickerDialog(activity, themeResId, new DatePickerDialog.OnDateSetListener() {
// 绑定监听器(How the parent is notified that the date is set.)
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
// 此处得到选择的时间,可以进行你想要的操作
tv.setText(year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
}
}
// 设置初始日期
, calendar.get(Calendar.YEAR)
, calendar.get(Calendar.MONTH)
, calendar.get(Calendar.DAY_OF_MONTH)).show();
}
public static void showTimePickerDialog(Activity activity, int themeResId, final TextView tv, Calendar calendar) {
// Calendar c = Calendar.getInstance();
// 创建一个TimePickerDialog实例并把它显示出来
// 解释一哈Activity是context的子类
new TimePickerDialog(activity, themeResId,
// 绑定监听器
new TimePickerDialog.OnTimeSetListener() {
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
tv.setText( hourOfDay + "时" + minute + "分");
}
}
// 设置初始时间
, calendar.get(Calendar.HOUR_OF_DAY)
, calendar.get(Calendar.MINUTE)
// true表示采用24小时制
, true).show();
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.btn_Date:
showDatePickerDialog(this, 5, txtDate, calendar);
;
break;
case btn_Time:
showTimePickerDialog(this, 2, txtTime, calendar);
break;
default:
break;
}
}
}

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

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>

Binary file not shown.

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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

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>

Binary file not shown.

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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

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>

Binary file not shown.

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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

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'
Loading…
Cancel
Save