Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ckmd #5

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
4 changes: 3 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<activity
android:name=".ui.menuselect.MenuSelectActivity"
android:label="@string/title_activity_menu_select" />
<activity android:name=".ui.inputnama.InputNamaActivity" />
<activity android:name=".ui.pilihavatar.PilihAvatarActivity" />
<activity android:name=".ui.konfirmasiakun.KonfirmasiAkunActivity"></activity>
<activity android:name=".ui.konfirmasiakun.KonfirmasiAkunActivity">
<activity android:name=".ui.buatAkun.BuatAkunActivity" />
<activity android:name=".ui.splashscreen.SplashScreenActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,24 @@ public AppDataManager(@ApplicationContext Context context,
mPreferencesHelper = preferencesHelper;
mApiHelper = apiHelper;
}

@Override
public void simpanNama(String nama) {
mPreferencesHelper.simpanNama(nama);
}

@Override
public String getNama() {
return mPreferencesHelper.getNama();
}

@Override
public void setAvatar(int avatar) {
mPreferencesHelper.setAvatar(avatar);
}

@Override
public int getAvatar() {
return mPreferencesHelper.getAvatar();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,25 @@ public AppPreferencesHelper(@ApplicationContext Context context,
@PreferenceInfo String prefFileName) {
mPrefs = context.getSharedPreferences(prefFileName, Context.MODE_PRIVATE);
}

@Override
public void simpanNama(String nama) {
mPrefs.edit().putString("nama", nama).apply();
}

@Override
public String getNama() {
return mPrefs.getString("nama", null);
}

@Override
public void setAvatar(int avatar) {
mPrefs.edit().putInt("avatar", avatar).apply();
}

@Override
public int getAvatar() {
return mPrefs.getInt("avatar",0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@

public interface PreferencesHelper {

void simpanNama(String nama);
String getNama();

void setAvatar(int avatar);
int getAvatar();

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

import com.squishydev.setoz.englishkidstalk.di.PerActivity;
import com.squishydev.setoz.englishkidstalk.di.module.ActivityModule;
<<<<<<< HEAD
import com.squishydev.setoz.englishkidstalk.ui.buatAkun.BuatAkunActivity;
import com.squishydev.setoz.englishkidstalk.ui.inputnama.InputNamaActivity;
=======
import com.squishydev.setoz.englishkidstalk.ui.inputnama.InputNamaActivity;
import com.squishydev.setoz.englishkidstalk.ui.konfirmasiakun.KonfirmasiAkunActivity;
import com.squishydev.setoz.englishkidstalk.ui.levelselect.fragment.LevelSelectFragment;
Expand All @@ -11,6 +15,7 @@
import com.squishydev.setoz.englishkidstalk.ui.menuselect.profilemenu.ProfileFragment;
import com.squishydev.setoz.englishkidstalk.ui.pilihavatar.PilihAvatarActivity;
import com.squishydev.setoz.englishkidstalk.ui.splashscreen.SplashScreenActivity;
>>>>>>> cedef8f54a54247d77537ea610273c5a91fb8cd7

import dagger.Component;

Expand All @@ -26,6 +31,10 @@
@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)
public interface ActivityComponent {

void inject(InputNamaActivity inputNamaActivity);

void inject(BuatAkunActivity buatAkunActivity);

void inject(SplashScreenActivity splashScreenActivity);

void inject(PilihAvatarActivity pilihAvatarActivity);
Expand All @@ -41,4 +50,4 @@ public interface ActivityComponent {
void inject(ProfileFragment profileFragment);

void inject(LevelSelectFragment levelSelectFragmentFragment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

import com.squishydev.setoz.englishkidstalk.di.ActivityContext;
import com.squishydev.setoz.englishkidstalk.di.PerActivity;
import com.squishydev.setoz.englishkidstalk.ui.buatAkun.BuatAkunMvpPresenter;
import com.squishydev.setoz.englishkidstalk.ui.buatAkun.BuatAkunMvpView;
import com.squishydev.setoz.englishkidstalk.ui.inputnama.InputNamaMvpPresenter;
import com.squishydev.setoz.englishkidstalk.ui.inputnama.InputNamaMvpView;
import com.squishydev.setoz.englishkidstalk.ui.inputnama.InputNamaMvpPresenter;
import com.squishydev.setoz.englishkidstalk.ui.inputnama.InputNamaMvpView;
import com.squishydev.setoz.englishkidstalk.ui.inputnama.InputNamaPresenter;
Expand Down Expand Up @@ -74,7 +78,20 @@ LinearLayoutManager provideLinearLayoutManager(AppCompatActivity activity) {
}

@Provides
LevelSelectMvpPresenter<LevelSelectMvpView> provideLevelSelectPresenter(LevelSelectPresenter<LevelSelectMvpView> presenter){
InputNamaMvpPresenter<InputNamaMvpView> provideInputNamaMvpPresenter(
InputNamaMvpPresenter<InputNamaMvpView> presenter){
return presenter;
}

@Provides
LevelSelectMvpPresenter<LevelSelectMvpView> provideLevelSelectPresenter(
LevelSelectPresenter<LevelSelectMvpView> presenter){
return presenter;
}

@Provides
BuatAkunMvpPresenter<BuatAkunMvpView> provideBuatAkunMvpPresenter(
BuatAkunMvpPresenter<BuatAkunMvpView> presenter){
return presenter;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public interface MvpView {

void hideLoading();

// void openActivityOnTokenExpire();

void onError(@StringRes int resId);

void onError(String message);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.squishydev.setoz.englishkidstalk.ui.buatAkun;

import android.content.Context;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;

import com.squishydev.setoz.englishkidstalk.R;
import com.squishydev.setoz.englishkidstalk.ui.base.BaseActivity;

import javax.inject.Inject;

public class BuatAkunActivity extends BaseActivity implements BuatAkunMvpView {

@Inject
BuatAkunMvpPresenter<BuatAkunMvpView> mPresenter;

public static Intent getStartIntent(Context context) {
Intent intent = new Intent(context, BuatAkunActivity.class);
return intent;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_buat_akun);

getActivityComponent().inject(this);

mPresenter.onAttach(BuatAkunActivity.this);
}

@Override
protected void onDestroy() {
mPresenter.onDetach();
super.onDestroy();
}

@Override
protected void setUp() {
ActivityBuatAkunBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_buat_akun);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.squishydev.setoz.englishkidstalk.ui.buatAkun;

import com.squishydev.setoz.englishkidstalk.di.PerActivity;
import com.squishydev.setoz.englishkidstalk.ui.base.MvpPresenter;

@PerActivity
public interface BuatAkunMvpPresenter<V extends BuatAkunMvpView> extends MvpPresenter<V> {

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.squishydev.setoz.englishkidstalk.ui.buatAkun;

import com.squishydev.setoz.englishkidstalk.ui.base.MvpView;

public interface BuatAkunMvpView extends MvpVie\w {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.squishydev.setoz.englishkidstalk.ui.buatAkun;

import com.squishydev.setoz.englishkidstalk.data.DataManager;
import com.squishydev.setoz.englishkidstalk.ui.base.BasePresenter;

import javax.inject.Inject;

import io.reactivex.disposables.CompositeDisposable;

public class BuatAkunPresenter<V extends BuatAkunMvpView> extends BasePresenter<V>
implements BuatAkunMvpPresenter<V> {

private static final String TAG = "BuatAkunPresenter";

@Inject
public BuatAkunPresenter(DataManager dataManager,
CompositeDisposable compositeDisposable) {
super(dataManager, compositeDisposable);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.View;

import com.squishydev.setoz.englishkidstalk.R;
import com.squishydev.setoz.englishkidstalk.databinding.ActivityInputNamaBinding;
Expand Down Expand Up @@ -39,9 +40,14 @@ protected void onDestroy() {

@Override
protected void setUp() {
ActivityInputNamaBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_input_nama);
binding.btnNext.setOnClickListener(v ->{
startActivity(new Intent(InputNamaActivity.this, PilihAvatarActivity.class));
final ActivityInputNamaBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_input_nama);
binding.btnNext1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String nama = binding.etNama;
mPresenter.simpanNama(nama);
startActivity(new Intent(InputNamaActivity.this, PilihAvatarActivity.class));
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

@PerActivity
public interface InputNamaMvpPresenter<V extends InputNamaMvpView> extends MvpPresenter<V> {
<<<<<<< HEAD
void simpanNama(String nama);
=======

>>>>>>> cedef8f54a54247d77537ea610273c5a91fb8cd7
}

Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ public InputNamaPresenter(DataManager dataManager,
super(dataManager, compositeDisposable);
}

@Override
public void simpanNama(String nama) {
getDataManager().simpanNama(nama);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ protected void setUp() {
binding.tvTidak.setOnClickListener(v -> {
startActivity(new Intent(KonfirmasiAkunActivity.this, LevelSelectActivity.class));
});
binding.btnIya.setOnClickListener(v -> {
startActivity(new Intent(KonfirmasiAkunActivity.this, BuatAkunActivity.class));
});
}
}
4 changes: 3 additions & 1 deletion app/src/main/res/layout/activity_buat_akun.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layout>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
Expand Down Expand Up @@ -119,4 +120,5 @@
android:textSize="16sp"
android:textStyle="bold" />

</RelativeLayout>
</RelativeLayout>
</layout>
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_challenge.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<TextView
android:layout_width="fill_parent"
android:layout_height="25dp"
android:hint="Alee"/>
android:hint="Alee"
android:fontFamily="casual"/>

<TextView
android:layout_width="fill_parent"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_input_nama.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
tools:text="Kenalan Dulu Yuk" />

<EditText
android:id="@+id/et_nama"
android:layout_width="300dp"
android:layout_height="40dp"
android:background="@drawable/edittext_input_nama"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_level_select_easy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:text="Lorem ipsum dolor sit ametLorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum "
android:textAlignment="center"
android:text="pada level ini terdapat materi vocabulary (kosakata) yang sesuai untuk pemula"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/tv_masuk"
app:layout_constraintHorizontal_bias="0.5"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_level_select_hard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:text="Lorem ipsum dolor sit ametLorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum "
android:textAlignment="center"
android:text="pada level ini terdapat materi vocabulary (kosakata), wrting (menulis) dan speaking (berbicara) yang sesuai untuk ahli"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/tv_masuk"
app:layout_constraintHorizontal_bias="0.5"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_level_select_medium.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:text="Lorem ipsum dolor sit ametLorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum "
android:textAlignment="center"
android:text="pada level ini terdapat materi vocabulary (kosakata) dan wrting (menulis) yang sesuai untuk menengah"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/tv_masuk"
app:layout_constraintStart_toStartOf="@+id/tv_masuk"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/fragment_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="#2"
android:text="-"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold"
Expand All @@ -181,7 +181,7 @@
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="89"
android:text="-"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold"
Expand All @@ -201,7 +201,7 @@
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="300"
android:text="-"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold"
Expand Down
Loading