diff --git a/app/src/main/java/com/example/meaning4/findMeaning.java b/app/src/main/java/com/example/meaning4/findMeaning.java index c034148..84b5450 100644 --- a/app/src/main/java/com/example/meaning4/findMeaning.java +++ b/app/src/main/java/com/example/meaning4/findMeaning.java @@ -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; @@ -64,7 +65,6 @@ public class findMeaning extends AppCompatActivity { List> listOfLists = new ArrayList<>(); List 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; @@ -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); @@ -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); diff --git a/app/src/main/res/drawable/arrowpng.png b/app/src/main/res/drawable/arrowpng.png new file mode 100644 index 0000000..eb59f37 Binary files /dev/null and b/app/src/main/res/drawable/arrowpng.png differ diff --git a/app/src/main/res/drawable/intro.jpg b/app/src/main/res/drawable/intro.jpg new file mode 100644 index 0000000..0f62bf0 Binary files /dev/null and b/app/src/main/res/drawable/intro.jpg differ diff --git a/app/src/main/res/layout/activity_find_meaning.xml b/app/src/main/res/layout/activity_find_meaning.xml index 84f518a..c0f67b0 100644 --- a/app/src/main/res/layout/activity_find_meaning.xml +++ b/app/src/main/res/layout/activity_find_meaning.xml @@ -110,6 +110,20 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/image98" /> + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 54f2fd3..fb2774c 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -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" /> + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dd49814..27a1080 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ meaning4 + 4ca7b53995e041cbab318cbde301835e