Skip to content

Commit

Permalink
Merge pull request #20 from inu-appcenter/feature
Browse files Browse the repository at this point in the history
Feature
  • Loading branch information
ryuspace authored Mar 9, 2020
2 parents cb6d774 + 5f8d394 commit e0783f6
Show file tree
Hide file tree
Showing 12 changed files with 623 additions and 349 deletions.
9 changes: 7 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.inuappcenter.shareu"
minSdkVersion 21
targetSdkVersion 28
versionCode 3
versionName "1.0.0"
versionCode 5
versionName "1.0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down Expand Up @@ -50,6 +50,7 @@ dependencies {
implementation 'com.google.android.material:material:1.0.0-rc01'

//file upload library
//https://github.com/HBiSoft/PickiT
implementation 'com.github.HBiSoft:PickiT:0.1.8'

//superior lecture indicator library
Expand Down Expand Up @@ -80,4 +81,8 @@ dependencies {
implementation 'com.github.viethoa:fastscroller:1.2.0'

implementation 'com.google.firebase:firebase-analytics:17.2.2'

//progress bar
//https://github.com/yankai-victor/Loading
implementation 'com.victor:lib:1.0.4'
}
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":3,"versionName":"1.0.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":5,"versionName":"1.0.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
12 changes: 12 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@
>

</activity>

<activity android:name=".activity.DownloadedActivity"
android:screenOrientation="portrait"
>

</activity>

<activity android:name=".activity.AlreadyDownloadedActivity"
android:screenOrientation="portrait"
>

</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.inuappcenter.shareu.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.inuappcenter.shareu.R;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class AlreadyDownloadedActivity extends AppCompatActivity {

private ImageButton btn_back_home;
private ImageButton btn_ok;
private TextView textView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_downloaded);
textView=findViewById(R.id.textView);
textView.setText("0");
btn_back_home = findViewById(R.id.btn_back_home);
btn_ok = findViewById(R.id.btn_ok);
btn_back_home.setOnClickListener(v->finish());
btn_ok.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(),MyGiveActivity.class);
startActivity(intent);
finish();

}
});
}

@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
Intent intent =getIntent();
key =intent.getExtras().getInt("key");
giveMePermissions();

listen();
Log.e("크리에이트","크리에이트");
}

@Override
protected void onResume() {
super.onResume();
listen();
Log.e("레쥬미","레쥬미");
flag=false;
giveMeStar();
giveMeList();
giveMeReview();
Expand Down Expand Up @@ -431,6 +433,7 @@ public void onResponse(Call<List<documentFile>> call, Response<List<documentFile
bottomSheetSparsePoint.show(getSupportFragmentManager(),"냐옹");
flag=true;
}

if(snackbar!=null && snackbar.isShown())
{
snackbar.dismiss();;
Expand Down Expand Up @@ -495,6 +498,7 @@ void giveFile2(String file)
url+="/"+sub_url;
String dirPath = "/storage/emulated/0/Share U";
String fileName = tv_my_major.getText()+bye+"."+hi;

snackbar = TSnackbar.make(findViewById(android.R.id.content),"자료 다운로드 중입니다...잠시만 기다려주세요",TSnackbar.LENGTH_INDEFINITE);
snackbar.setActionTextColor(Color.WHITE);
View snackbarView = snackbar.getView();
Expand Down Expand Up @@ -526,7 +530,10 @@ public void onCancel() {
.setOnProgressListener(new OnProgressListener() {
@Override
public void onProgress(Progress progress) {
Log.e("onProgress()","");
snackbar.setText("자료 다운로드 중입니다...잠시만 기다려주세요 "+"("+progress.currentBytes+" / "+progress.totalBytes+")");
tv_get_file.setText("자료 받기 진행중");
tv_get_file.setBackgroundColor(Color.parseColor("#a8a8a8"));
//Log.e("onProgress()",progress.currentBytes+" "+progress.totalBytes);
}
})
.start(new OnDownloadListener() {
Expand All @@ -536,11 +543,11 @@ public void onDownloadComplete() {
{
snackbar.dismiss();;
}
tv_get_file.setText("자료 받기 완료");
tv_get_file.setBackgroundColor(Color.parseColor("#a8a8a8"));

if(flag==false)
{
tv_get_file.setText("자료 받기 완료");
tv_get_file.setBackgroundColor(Color.parseColor("#a8a8a8"));

bottomSheetZeroPoint=new BottomSheetZeroPoint();
bottomSheetZeroPoint.show(getSupportFragmentManager(),"냐옹");
flag=true;
Expand All @@ -554,6 +561,11 @@ public void onDownloadComplete() {
}
tv_register.setClickable(true);
}
else
{
Intent intent = new Intent(getApplicationContext(),AlreadyDownloadedActivity.class);
startActivity(intent);
}

}

Expand Down Expand Up @@ -584,6 +596,7 @@ void giveFile(String file)
String dirPath = "/storage/emulated/0/Share U";
String fileName = tv_my_major.getText()+bye+"."+hi;


snackbar = TSnackbar.make(findViewById(android.R.id.content),"자료 다운로드 중입니다...잠시만 기다려주세요",TSnackbar.LENGTH_INDEFINITE);
snackbar.setActionTextColor(Color.WHITE);
View snackbarView = snackbar.getView();
Expand Down Expand Up @@ -614,7 +627,11 @@ public void onCancel() {
.setOnProgressListener(new OnProgressListener() {
@Override
public void onProgress(Progress progress) {
Log.e("onProgress()","");

snackbar.setText("자료 다운로드 중입니다...잠시만 기다려주세요 "+"("+progress.currentBytes+" / "+progress.totalBytes+")");
tv_get_file.setText("자료 받기 진행중");
tv_get_file.setBackgroundColor(Color.parseColor("#a8a8a8"));
Log.e("onProgress()",progress+"");
}
})
.start(new OnDownloadListener() {
Expand All @@ -624,24 +641,24 @@ public void onDownloadComplete() {
{
snackbar.dismiss();;
}
tv_get_file.setText("자료 받기 완료");
tv_get_file.setBackgroundColor(Color.parseColor("#a8a8a8"));
if(flag==false)
{
tv_get_file.setText("자료 받기 완료");
tv_get_file.setBackgroundColor(Color.parseColor("#a8a8a8"));
bottomSheetMinusPoint=new BottomSheetMinusPoint();
bottomSheetMinusPoint.show(getSupportFragmentManager(),"냐옹");
flag=true;
if(snackbar!=null && snackbar.isShown())
{
snackbar.dismiss();;
}
if(snackbar!=null && snackbar.isShown())
{
snackbar.dismiss();;
}

tv_register.setClickable(true);
}
else
{
Intent intent = new Intent(getApplicationContext(),DownloadedActivity.class);
startActivity(intent);
}

}

Expand Down Expand Up @@ -711,62 +728,6 @@ public void onFailure(Call<List<sendFileExtension>> call, Throwable t) {
@Override
public void onChanged(String s) {


/*Log.e("변신!",extension.getValue());
Date today = new Date();
String bye=today.getTime()+"";
sub_url=response.body().get(0).getFileName();
url = "http://117.16.231.66:7001/document/send/documentFile";
url+="/"+sub_url;
String dirPath = "/storage/emulated/0/Share U";
String fileName = tv_my_major.getText()+bye+"."+hi;
PRDownloader.download(url, dirPath, fileName)
.build()
.setOnStartOrResumeListener(new OnStartOrResumeListener() {
@Override
public void onStartOrResume() {
Log.e("onStartOrResume()","");
}
})
.setOnPauseListener(new OnPauseListener() {
@Override
public void onPause() {
Log.e("onPause()","");
}
})
.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel() {
Log.e("onCancel()","");
}
})
.setOnProgressListener(new OnProgressListener() {
@Override
public void onProgress(Progress progress) {
Log.e("onProgress()","");
}
})
.start(new OnDownloadListener() {
@Override
public void onDownloadComplete() {
if(flag==false)
{
bottomSheetZeroPoint = new BottomSheetZeroPoint();
bottomSheetZeroPoint.show(getSupportFragmentManager(),"냐옹");
flag=true;
}
}
@Override
public void onError(Error error) {
Log.e("onError()","");
}
});*/

}
});

Expand Down Expand Up @@ -846,6 +807,7 @@ public void onResponse(Call<BooleanFuck> call, Response<BooleanFuck> response) {
snackbar.dismiss();;
}
}

giveMeStar();
giveMeReview();
}
Expand Down Expand Up @@ -889,28 +851,30 @@ private void giveMePermissions() {

@Override
protected void onStop() {
flag=true;
super.onStop();
//Log.e("스탑","씨발 왜 아무것도 안오냐고");

}

@Override
protected void onPause() {
super.onPause();
//Log.e("퍼즈","씨발 왜 아무것도 안오냐고");
flag=true;
Log.e("퍼즈","퍼즈");
if(snackbar!=null && snackbar.isShown())
{
snackbar.dismiss();;
snackbar.dismiss();
}

}

@Override
protected void onDestroy() {
//Log.e("온ㅏ여기","씨발 왜 아무것도 안오냐고");
Log.e("디스트로이","디스트로이");
super.onDestroy();
if(snackbar!=null && snackbar.isShown())
{
snackbar.dismiss();;
}
flag=true;


}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.inuappcenter.shareu.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.inuappcenter.shareu.R;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class DownloadedActivity extends AppCompatActivity {

private ImageButton btn_back_home;
private ImageButton btn_ok;
private TextView textView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_downloaded);
textView=findViewById(R.id.textView);
textView.setText("-3");
btn_back_home = findViewById(R.id.btn_back_home);
btn_ok = findViewById(R.id.btn_ok);
btn_back_home.setOnClickListener(v->finish());
btn_ok.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(),MyGiveActivity.class);
startActivity(intent);
finish();

}
});
}

@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
}

Loading

0 comments on commit e0783f6

Please sign in to comment.