Skip to content

Commit 3820bfd

Browse files
Merge pull request #30 from krharsh17/AppFinalisation
code almost complete
2 parents 3e96b3b + c52fd99 commit 3820bfd

File tree

6 files changed

+77
-1
lines changed

6 files changed

+77
-1
lines changed

app/src/main/java/in/krharsh17/programmersdate/events/LogoActivity.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
import android.os.Environment;
99
import android.os.Handler;
1010
import android.util.Log;
11+
import android.view.View;
1112
import android.widget.FrameLayout;
13+
import android.widget.TextView;
1214

1315
import androidx.appcompat.app.AppCompatActivity;
1416

1517
import com.aar.tapholdupbutton.TapHoldUpButton;
1618
import com.google.android.gms.tasks.OnSuccessListener;
1719
import com.google.firebase.storage.FileDownloadTask;
1820
import com.google.firebase.storage.FirebaseStorage;
21+
import com.peekandpop.shalskar.peekandpop.PeekAndPop;
1922

2023
import org.opencv.core.DMatch;
2124
import org.opencv.core.Mat;
@@ -48,6 +51,8 @@ public class LogoActivity extends AppCompatActivity implements Constants {
4851
boolean isSuccess = false, safeToCapture = false;
4952
Handler handler;
5053
private TapHoldUpButton hint;
54+
TextView hintText;
55+
PeekAndPop peekAndPop;
5156

5257
public static Camera getCameraInstance() {
5358
Camera c = null;
@@ -70,6 +75,13 @@ public void onBackPressed() {
7075
protected void onCreate(Bundle savedInstanceState) {
7176
super.onCreate(savedInstanceState);
7277
setContentView(R.layout.activity_logo);
78+
hint = findViewById(R.id.hint_button);
79+
peekAndPop = new PeekAndPop.Builder(this)
80+
.peekLayout(R.layout.dialog_hint)
81+
.longClickViews(hint)
82+
.build();
83+
View peekView = peekAndPop.getPeekView();
84+
hintText = peekView.findViewById(R.id.hint_text);
7385
mCamera = getCameraInstance();
7486
// Create our Preview view and set it as the content of our activity.
7587
mPreview = new CameraPreview(this, mCamera);
@@ -93,6 +105,7 @@ public void onCoupleFetched(Couple couple) {
93105
currentlevel = couple.getCurrentLevel();
94106
coupleId = couple.getId();
95107
level = couple.getLevels().get(currentlevel-1);
108+
hintText.setText(level.getLevelHint());
96109
String root = Environment.getExternalStorageDirectory().toString();
97110
File myDir = new File(root);
98111
myDir.mkdirs();
@@ -126,6 +139,24 @@ public void onErrorOccured(String message) {
126139

127140
}
128141
});
142+
143+
hint.setOnButtonClickListener(new TapHoldUpButton.OnButtonClickListener() {
144+
@Override
145+
public void onLongHoldStart(View v) {
146+
147+
}
148+
149+
@Override
150+
public void onLongHoldEnd(View v) {
151+
152+
}
153+
154+
@Override
155+
public void onClick(View v) {
156+
157+
}
158+
});
159+
129160
}
130161

131162
static {

app/src/main/java/in/krharsh17/programmersdate/models/Level.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ public class Level {
1111
private String poseValue;
1212
private String logoValue;
1313
private String audioValue;
14+
private String levelHint;
15+
16+
public String getLevelHint() {
17+
return levelHint;
18+
}
19+
20+
public void setLevelHint(String levelHint) {
21+
this.levelHint = levelHint;
22+
}
23+
1424
private boolean skipped;
1525

1626
public boolean isSkipped() {
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="wrap_content"
6+
android:layout_height="wrap_content"
7+
android:layout_gravity="center"
8+
android:translationZ="5dp"
9+
app:cardBackgroundColor="#10192B"
10+
app:cardElevation="16dp">
11+
12+
<androidx.constraintlayout.widget.ConstraintLayout
13+
android:layout_width="250dp"
14+
android:layout_height="wrap_content"
15+
android:layout_margin="32dp">
16+
17+
<TextView
18+
android:id="@+id/hint_text"
19+
android:layout_width="wrap_content"
20+
android:layout_height="wrap_content"
21+
android:layout_margin="8dp"
22+
android:fontFamily="@font/poiretone"
23+
android:textAlignment="center"
24+
android:textColor="@color/colorAccent"
25+
android:textSize="18sp"
26+
app:layout_constraintEnd_toEndOf="parent"
27+
app:layout_constraintHorizontal_bias="0.5"
28+
app:layout_constraintStart_toStartOf="parent"
29+
app:layout_constraintTop_toTopOf="parent"
30+
tools:text="Are you sure you want to skip this level?" />
31+
32+
33+
</androidx.constraintlayout.widget.ConstraintLayout>
34+
35+
</androidx.cardview.widget.CardView>
0 Bytes
Binary file not shown.
22 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#Wed Jan 29 23:53:58 IST 2020
1+
#Thu Jan 30 00:33:04 IST 2020

0 commit comments

Comments
 (0)