Skip to content

Commit

Permalink
Merge pull request #73 from BCSDLab/release/v3.0.1
Browse files Browse the repository at this point in the history
Release/v3.0.1
  • Loading branch information
yunjaena authored Feb 6, 2021
2 parents 89607ca + 600e6d9 commit 11aefa2
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 4,227 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ local.properties

# Gradle generated files
.gradle/
gradlew
gradlew.bat


# Signing files
.signing/
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ Koreatech Community Project (ver. Android)
- 시간표 테두리 변경
- 위젯 자동 업데이트 변경
- 카테고리 유지 안됨 수정

- 2.2.3
- 복덕방 서비스 추가
- 분실물 서비스 추가
- 비밀번호 검사 로직 변경

- 2.2.4
- 버스시간표 수정

- 2.2.5
- 식단표 위젯 추가
- 버스 위젯 추가
Expand All @@ -84,10 +84,10 @@ Koreatech Community Project (ver. Android)
- 시간표 학기별 조회 기능 추가
- 에티터 추가
- 버스 시간표 업데이트

- 2.2.8
- 로그인시 중고 장터 접근 안 되는 버그 수정

- 3.0.0
- 서비스 축소
- 주변 상점
Expand All @@ -98,6 +98,13 @@ Koreatech Community Project (ver. Android)
- 메인 화면 변경
- Navigation Drawer 변경

- 3.0.1
- 버그 수정
- 상점 전화 번호 출력 오류 수정
- 상점 주소 출력 오류 수정
- Firebase Event 추가
- 상점 진입 후 상점에 전화하는 시간 이벤트 추가


## Technology stack
- Java 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class RetrofitManager {
private static RetrofitManager instance = null;

public static final String BASE_URL_PRODUCTION = "https://api.koreatech.in"; //release server
public static final String BASE_URL_STAGE = "http://stage.api.koreatech.in"; //development server
public static final String BASE_URL_STAGE = "https://api.koreatech.in"; //development server

private Retrofit retrofit;

Expand Down
4 changes: 2 additions & 2 deletions koin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ String applicationName = 'koin'
android {
defaultConfig {
applicationId "in.koreatech.koin"
versionCode 30000
versionCode 30001
minSdkVersion 21
compileSdkVersion project.compileSdkVersion
minSdkVersion project.minSdkVersion
targetSdkVersion project.targetSdkVersion
versionName "3.0.0"
versionName "3.0.1"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
Expand Down
1 change: 1 addition & 0 deletions koin/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
tools:replace="android:name">
<activity android:name=".ui.main.MainActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import in.koreatech.koin.ui.store.adapter.StoreRecyclerAdapter;
import in.koreatech.koin.ui.store.presenter.StoreContract;
import in.koreatech.koin.ui.store.presenter.StorePresenter;
import in.koreatech.koin.util.FirebaseEventUtil;

public class StoreActivity extends KoinNavigationDrawerActivity implements StoreContract.View, SwipeRefreshLayout.OnRefreshListener {
private final String TAG = StoreActivity.class.getSimpleName();
Expand Down Expand Up @@ -73,6 +74,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
ButterKnife.bind(this);
context = this;
init();
FirebaseEventUtil.getInstance(this).startTrackStoreCallTime();
//TODO:필터기능 추가
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.view.GravityCompat;
Expand All @@ -40,6 +39,7 @@
import in.koreatech.koin.ui.store.adapter.StoreDetailMenuRecyclerAdapter;
import in.koreatech.koin.ui.store.presenter.StoreDetailContract;
import in.koreatech.koin.ui.store.presenter.StoreDetailPresenter;
import in.koreatech.koin.util.FirebaseEventUtil;
import in.koreatech.koin.util.FormValidatorUtil;

public class StoreDetailActivity extends KoinNavigationDrawerActivity implements StoreDetailContract.View {
Expand Down Expand Up @@ -209,13 +209,21 @@ public void updateUserInterface() {
if (this.store.getPhone() == null) {
phoneTextView.setText("-");
storeDetailCallButton.setVisibility(View.INVISIBLE);
} else {
phoneTextView.setText(this.store.getPhone());
}
if (this.store.getAddress() == null) {
addressTextview.setText("-");
} else {
addressTextview.setText(this.store.getAddress());
}

if (this.store.getDescription() == null) {
etcTextview.setText("-");
} else {
etcTextview.setText(this.store.getDescription());
}

/*
phoneTextView.setText(Objects.requireNonNull(this.store.phone,"-"));
addressTextview.setText(Objects.requireNonNullElse(this.store.address,"-"));
Expand Down Expand Up @@ -249,13 +257,14 @@ public void onClickedStoreCallButton() {
requestPermission();

AlertDialog.Builder builder;
builder = new AlertDialog.Builder(new ContextThemeWrapper(this.context, R.style.KAPDialog));
builder = new AlertDialog.Builder(context);

builder.setMessage(this.store.getName() + "\n\n" + this.store.getPhone());

builder.setPositiveButton("통화",
(dialog, which) -> {
onClickCallButton(); //call intent 수행
FirebaseEventUtil.getInstance(this).endTrackStoreCallTime();
});
builder.setNegativeButton("취소",
(dialog, which) -> dialog.dismiss());
Expand Down
97 changes: 97 additions & 0 deletions koin/src/main/java/in/koreatech/koin/util/FirebaseEventUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
package in.koreatech.koin.util;

import android.content.Context;
import android.os.Bundle;

import androidx.annotation.NonNull;

import com.google.firebase.analytics.FirebaseAnalytics;

import java.util.Date;
import java.util.HashMap;
import java.util.Locale;

import in.koreatech.koin.BuildConfig;

public class FirebaseEventUtil {
private static FirebaseEventUtil instance = null;
public final String DATE_FORMAT = "%d일 %d시간 %d분 %d초";
public final String STORE_CALL_ELAPSE_TIME = "store_call_elapse_time";
public final String START = "start";
public final String END = "end";
public final String DURATION = "duration";
public final String DURATION_FORMAT = "duration_format";

private FirebaseAnalytics firebaseAnalytics;
private HashMap<String, Date> storeCallTrackHashMap;

private FirebaseEventUtil(@NonNull Context context) {
firebaseAnalytics = FirebaseAnalytics.getInstance(context.getApplicationContext());
}

public static FirebaseEventUtil getInstance(@NonNull Context context) {
if (instance == null) {
synchronized (FirebaseEventUtil.class) {
instance = new FirebaseEventUtil(context);
}
}
return instance;
}

public void startTrackStoreCallTime() {
if (storeCallTrackHashMap == null)
storeCallTrackHashMap = new HashMap<>();

storeCallTrackHashMap.put(START, getCurrentDate());

}

public void endTrackStoreCallTime() {
if (storeCallTrackHashMap == null || !storeCallTrackHashMap.containsKey(START))
return;

Date startDate = storeCallTrackHashMap.get(START);
Date endDate = getCurrentDate();
long duration = endDate.getTime() - startDate.getTime();
if(duration > 0) {
Bundle bundle = new Bundle();
bundle.putLong(START, startDate.getTime());
bundle.putLong(END, endDate.getTime());
bundle.putLong(DURATION, duration);
bundle.putString(DURATION_FORMAT, longToDateString(duration));
track(STORE_CALL_ELAPSE_TIME, bundle);
}
storeCallTrackHashMap = null;
}

private void track(String name, Bundle bundle) {
if (!BuildConfig.IS_DEBUG) {
firebaseAnalytics.logEvent(name, bundle);
}
}


private Date getCurrentDate() {
return new Date();
}

private String longToDateString(long different) {
long secondsInMilli = 1000;
long minutesInMilli = secondsInMilli * 60;
long hoursInMilli = minutesInMilli * 60;
long daysInMilli = hoursInMilli * 24;

long elapsedDays = different / daysInMilli;
different = different % daysInMilli;

long elapsedHours = different / hoursInMilli;
different = different % hoursInMilli;

long elapsedMinutes = different / minutesInMilli;
different = different % minutesInMilli;

long elapsedSeconds = different / secondsInMilli;

return String.format(Locale.KOREA, DATE_FORMAT, elapsedDays, elapsedHours, elapsedMinutes, elapsedSeconds);
}
}
Loading

0 comments on commit 11aefa2

Please sign in to comment.