Skip to content

Commit

Permalink
Version-1 final
Browse files Browse the repository at this point in the history
  • Loading branch information
aadityaguptaa committed Aug 8, 2020
1 parent e924b10 commit 0190cd9
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 3 deletions.
28 changes: 27 additions & 1 deletion app/src/main/java/com/example/meaning4/findMeaning.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
Expand Down Expand Up @@ -64,7 +65,6 @@ public class findMeaning extends AppCompatActivity {
List<List<Integer>> listOfLists = new ArrayList<>();
List<String> listOfWords = new ArrayList<>();
public int selectedInt;
public String selectedString;
public Bitmap mSelectedImage;
static final int REQUEST_IMAGE_CAPTURE = 1;
static final int REQUEST_TAKE_PHOTO = 1;
Expand All @@ -85,6 +85,30 @@ protected void onCreate(Bundle savedInstanceState) {
imageView.getLocationOnScreen(viewCoords);
Log.i("coords", viewCoords[0]+" "+viewCoords[1]);

TextView knowmore = findViewById(R.id.knowmore);
knowmore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://"));
final ResolveInfo resolveInfo = getApplicationContext().getPackageManager()
.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
String defaultBrowserPackageName = resolveInfo.activityInfo.packageName;

String url = "https://www.oxfordlearnersdictionaries.com/definition/english/"+listOfWords.get(selectedInt);
final Intent intent2 = new Intent(Intent.ACTION_VIEW);
intent2.setData(Uri.parse(url));

if (!defaultBrowserPackageName.equals("android")){
// android = no default browser is set
// (android < 6 or fresh browser install or simply no default set)
// if it's the case (not in this block), it will just use normal way.
intent2.setPackage(defaultBrowserPackageName);
}

startActivity(intent2);
}
});

View bottomSheet = findViewById(R.id.bottomSheet);
final BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
Button findAnotherMeaning = findViewById(R.id.findAnotherMeaning);
Expand Down Expand Up @@ -119,6 +143,8 @@ public void onClick(View v) {
cameraClick.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ImageView tapHere = findViewById(R.id.tapHere);
tapHere.setVisibility(View.INVISIBLE);
String fileName = "photo";
File storageDirectory = getExternalFilesDir(Environment.DIRECTORY_PICTURES);

Expand Down
Binary file added app/src/main/res/drawable/arrowpng.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/intro.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions app/src/main/res/layout/activity_find_meaning.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/image98" />

<ImageView
android:id="@+id/tapHere"
android:layout_width="141dp"
android:layout_height="126dp"
android:layout_marginStart="36dp"
android:rotation="130"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/image98"
app:layout_constraintVertical_bias="0.866"
app:srcCompat="@drawable/arrowpng" />

</androidx.constraintlayout.widget.ConstraintLayout>

<include layout="@layout/bottom_sheet_persistent" />
Expand Down
33 changes: 31 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,39 @@
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:backgroundTint="#050505"
android:text="Lets Go ->"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.482"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.948" />

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/intro" />

<TextView
android:id="@+id/textView2"
android:layout_width="366dp"
android:layout_height="116dp"
android:fontFamily="@font/covered_by_your_grace"
android:text="Searching on google everytime you find a new word might be a tidious process. Well, just tap on the word and you are good to go"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.488"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0" />

</androidx.constraintlayout.widget.ConstraintLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">meaning4</string>
<string name="key">4ca7b53995e041cbab318cbde301835e</string>
</resources>

0 comments on commit 0190cd9

Please sign in to comment.