diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml
index 7af04eea..f069acf3 100644
--- a/.idea/assetWizardSettings.xml
+++ b/.idea/assetWizardSettings.xml
@@ -35,11 +35,9 @@
diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
index b932bb22..3aa745bf 100644
Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ
diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser
index 0240e1ba..7daceb94 100644
Binary files a/.idea/caches/gradle_models.ser and b/.idea/caches/gradle_models.ser differ
diff --git a/app/build.gradle b/app/build.gradle
index bf88d288..38709efd 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -33,8 +33,8 @@ repositories {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
- implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
- implementation 'com.google.android.material:material:1.1.0-alpha07'
+ implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
+ implementation 'com.google.android.material:material:1.1.0-alpha08'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
index bdcfece5..f452cb66 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
@@ -15,7 +15,6 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBarDrawerToggle;
-import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.GravityCompat;
@@ -28,6 +27,7 @@ import com.bumptech.glide.request.RequestOptions;
import com.ferfalk.simplesearchview.SimpleSearchView;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
+import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import javax.inject.Inject;
@@ -57,6 +57,13 @@ public class MainActivity extends AppCompatActivity {
@BindView(R.id.settings_linear_layout_main_activity) LinearLayout settingsLinearLayout;
@BindView(R.id.fab_main_activity) FloatingActionButton fab;
+ private LinearLayout textTypeLinearLayout;
+ private LinearLayout linkTypeLinearLayout;
+ private LinearLayout imageTypeLinearLayout;
+ private LinearLayout videoTypeLinearLayout;
+
+ private BottomSheetDialog dialog;
+
private TextView mNameTextView;
private TextView mKarmaTextView;
private GifImageView mProfileImageView;
@@ -95,6 +102,15 @@ public class MainActivity extends AppCompatActivity {
ButterKnife.bind(this);
+ View dialogView = View.inflate(this, R.layout.post_type_bottom_sheet, null);
+ textTypeLinearLayout = dialogView.findViewById(R.id.text_type_linear_layout_post_type_bottom_sheet);
+ linkTypeLinearLayout = dialogView.findViewById(R.id.link_type_linear_layout_post_type_bottom_sheet);
+ imageTypeLinearLayout = dialogView.findViewById(R.id.image_type_linear_layout_post_type_bottom_sheet);
+ videoTypeLinearLayout = dialogView.findViewById(R.id.video_type_linear_layout_post_type_bottom_sheet);
+
+ dialog = new BottomSheetDialog(this);
+ dialog.setContentView(dialogView);
+
((Infinity) getApplication()).getmAppComponent().inject(this);
Toolbar toolbar = findViewById(R.id.toolbar);
@@ -221,27 +237,27 @@ public class MainActivity extends AppCompatActivity {
});
}
- fab.setOnClickListener(view -> {
- new AlertDialog.Builder(this).setTitle(R.string.dialog_post_type)
- .setItems(R.array.dialog_post_types_array, (dialog, which) -> {
- Intent intent;
- switch (which) {
- case 0:
- intent = new Intent(this, PostTextActivity.class);
- break;
- case 1:
- intent = new Intent(this, PostLinkActivity.class);
- break;
- case 2:
- Toast.makeText(this, "Not implemented yet", Toast.LENGTH_SHORT).show();
- return;
- default:
- Toast.makeText(this, "Not implemented yet", Toast.LENGTH_SHORT).show();
- return;
- }
+ textTypeLinearLayout.setOnClickListener(view -> {
+ Intent intent = new Intent(MainActivity.this, PostTextActivity.class);
+ startActivity(intent);
+ dialog.dismiss();
+ });
+ linkTypeLinearLayout.setOnClickListener(view -> {
+ Intent intent = new Intent(MainActivity.this, PostLinkActivity.class);
+ startActivity(intent);
+ dialog.dismiss();
+ });
+ imageTypeLinearLayout.setOnClickListener(view -> {
+ Toast.makeText(this, "Not implemented yet", Toast.LENGTH_SHORT).show();
+ dialog.dismiss();
+ });
+ videoTypeLinearLayout.setOnClickListener(view -> {
+ Toast.makeText(this, "Not implemented yet", Toast.LENGTH_SHORT).show();
+ dialog.dismiss();
+ });
- startActivity(intent);
- }).show();
+ fab.setOnClickListener(view -> {
+ dialog.show();
});
}
diff --git a/app/src/main/res/drawable-hdpi/ic_link.png b/app/src/main/res/drawable-hdpi/ic_link.png
deleted file mode 100644
index 151e101d..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_link.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_link.png b/app/src/main/res/drawable-mdpi/ic_link.png
deleted file mode 100644
index d407acb5..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_link.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_link.png b/app/src/main/res/drawable-xhdpi/ic_link.png
deleted file mode 100644
index 34062296..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_link.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_link.png b/app/src/main/res/drawable-xxhdpi/ic_link.png
deleted file mode 100644
index 9b2ad879..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_link.png and /dev/null differ
diff --git a/app/src/main/res/drawable/ic_link.xml b/app/src/main/res/drawable/ic_link.xml
new file mode 100644
index 00000000..bfe6b0c4
--- /dev/null
+++ b/app/src/main/res/drawable/ic_link.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_outline_check_circle_outline_24px.xml b/app/src/main/res/drawable/ic_outline_check_circle_outline_24px.xml
new file mode 100644
index 00000000..eab33694
--- /dev/null
+++ b/app/src/main/res/drawable/ic_outline_check_circle_outline_24px.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_outline_settings_24px.xml b/app/src/main/res/drawable/ic_outline_settings_24px.xml
new file mode 100644
index 00000000..e1fb6a23
--- /dev/null
+++ b/app/src/main/res/drawable/ic_outline_settings_24px.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_outline_text_24px.xml b/app/src/main/res/drawable/ic_outline_text_24px.xml
new file mode 100644
index 00000000..6afe43f5
--- /dev/null
+++ b/app/src/main/res/drawable/ic_outline_text_24px.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_outline_video_label_24px.xml b/app/src/main/res/drawable/ic_outline_video_label_24px.xml
new file mode 100644
index 00000000..2c421e88
--- /dev/null
+++ b/app/src/main/res/drawable/ic_outline_video_label_24px.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 6c30dbc2..fc198172 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -72,7 +72,7 @@
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="32dp"
- android:src="@drawable/ic_outline_account_circle_24px"
+ android:src="@drawable/ic_outline_check_circle_outline_24px"
android:tint="@color/primaryTextColor"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 d2b3a8a8..4faecc7a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -104,10 +104,8 @@
Users
Post
-
- - Text
- - Link
- - Image
- - Video
-
+ Text
+ Link
+ Image
+ Video
diff --git a/build.gradle b/build.gradle
index c90ac9cd..367dc7bf 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.4.1'
+ classpath 'com.android.tools.build:gradle:3.4.2'
// NOTE: Do not place your application dependencies here; they belong
@@ -31,6 +31,6 @@ task clean(type: Delete) {
}
ext {
- roomVersion = '2.1.0-rc01'
- archLifecycleVersion = '2.2.0-alpha01'
+ roomVersion = '2.2.0-alpha01'
+ archLifecycleVersion = '2.2.0-alpha02'
}
\ No newline at end of file