diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..681f41a --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,116 @@ + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/app/src/main/java/com/example/cosmosclient/services/CosomosBackgroundService.java b/app/src/main/java/com/example/cosmosclient/services/CosomosBackgroundService.java index 68a3f40..cd2f3e8 100644 --- a/app/src/main/java/com/example/cosmosclient/services/CosomosBackgroundService.java +++ b/app/src/main/java/com/example/cosmosclient/services/CosomosBackgroundService.java @@ -111,7 +111,7 @@ } }; //timer.scheduleAtFixedRate(定期的に実行したいタスク,初回のタスク実行までの時間(ms),実行するタスクの間隔(ms)); - timer.scheduleAtFixedRate(task, 10000, 300000); + timer.scheduleAtFixedRate(task, 10000, 30000); return START_NOT_STICKY; } diff --git a/app/src/main/java/com/example/cosmosclient/services/NotificationDone.java b/app/src/main/java/com/example/cosmosclient/services/NotificationDone.java new file mode 100644 index 0000000..a1c3cb9 --- /dev/null +++ b/app/src/main/java/com/example/cosmosclient/services/NotificationDone.java @@ -0,0 +1,53 @@ +package com.example.cosmosclient.services; + +import android.os.Handler; + +import com.example.cosmosclient.entities.AddRequestsResponse; +import com.example.cosmosclient.entities.Group; +import com.example.cosmosclient.entities.Request; +import com.example.cosmosclient.resources.GroupsRest; + +import java.io.IOException; + +import retrofit2.Call; +import retrofit2.Response; +import retrofit2.Retrofit; +import retrofit2.converter.jackson.JacksonConverterFactory; + +public class NotificationDone { + //retrofitの処理 + final Retrofit retrofit = new Retrofit.Builder() + .baseUrl("http://nitta-lab-www.is.konan-u.ac.jp/cosmos/rest/") + // .baseUrl("http://10.0.2.2:8080/rest/") + .addConverterFactory(JacksonConverterFactory.create()) + .build(); + //interfaceから実装を取得 + final GroupsRest requestsService = retrofit.create(GroupsRest.class); + + + public void onClick(Notification notification){ + Group group = notification.getGroup(); + Request request = notification.getRequest(); + + String deadline = null; + if (request.getDeadline() != null) { + deadline = String.format("%d-%02d-%02d %02d:%02d:%02d", request.getDeadline().getYear(), request.getDeadline().getMonth() + 1, request.getDeadline().getDate() + 1, 23, 59, 59); + } + + try { + final Call updateRequestCall = requestsService.updateRequest(group.getgId(), request.getrId(), request.getIssuer().getuId(), request.getProduct(), deadline, request.getLocation(), true, "token"); + Response response = updateRequestCall.execute(); + if (!response.isSuccessful()) { + // onFailure + try { + System.out.println(response.errorBody().string()); + } catch (IOException e) { + e.printStackTrace(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/app/src/main/java/com/example/cosmosclient/views/SignupActivity.java b/app/src/main/java/com/example/cosmosclient/views/SignupActivity.java index afa76b9..619aa72 100644 --- a/app/src/main/java/com/example/cosmosclient/views/SignupActivity.java +++ b/app/src/main/java/com/example/cosmosclient/views/SignupActivity.java @@ -229,23 +229,23 @@ @Override public void afterTextChanged(Editable s){ + final int maxStringLength = 21; switch(view.getId()) { case R.id.NameText: - if (s.length() > 0) { + if (0 < s.length() && s.length() < maxStringLength){ nameEnable = true; - } else { - nameEnable = false; + } else { nameEnable = false; } break; case R.id.PasswordText: - if(s.length()>0){ + if(0 < s.length() && s.length() < maxStringLength){ pwEnable=true; }else{ pwEnable=false; } break; case R.id.ConfirmPasswordText: - if(s.length()>0){ + if(0 < s.length() && s.length() < maxStringLength){ cpwEnable=true; }else{ cpwEnable=false; diff --git a/build.gradle b/build.gradle index 02199bb..fb516be 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' + classpath 'com.android.tools.build:gradle:3.5.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7c22eb8..70579c4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu May 23 16:30:34 JST 2019 +#Tue Nov 05 12:49:58 JST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip