Skip to content

Commit

Permalink
Removed omnibin completely
Browse files Browse the repository at this point in the history
  • Loading branch information
F0x1d committed Dec 25, 2022
1 parent 1dee19e commit 8c21ac4
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 107 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "com.f0x1d.logfox"
minSdk 21
targetSdk 33
versionCode 23
versionName "1.2.2"
versionCode 24
versionName "1.2.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -61,20 +61,20 @@ dependencies {
implementation "androidx.room:room-ktx:2.4.3"
kapt "androidx.room:room-compiler:2.4.3"

implementation "com.google.dagger:hilt-android:2.43.2"
kapt "com.google.dagger:hilt-compiler:2.43.2"
implementation "com.google.dagger:hilt-android:2.44.2"
kapt "com.google.dagger:hilt-compiler:2.44.2"
implementation 'androidx.hilt:hilt-navigation-fragment:1.0.0'

implementation "androidx.core:core-ktx:1.9.0"
implementation "androidx.collection:collection-ktx:1.2.0"
implementation "androidx.fragment:fragment-ktx:1.5.4"
implementation "androidx.fragment:fragment-ktx:1.5.5"
implementation "androidx.preference:preference-ktx:1.2.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.0-alpha03"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"

implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.8.0-alpha02'
implementation 'com.google.android.material:material:1.8.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation "androidx.recyclerview:recyclerview:1.2.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.f0x1d.logfox.extensions

import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.os.Build
Expand All @@ -11,7 +10,6 @@ import com.f0x1d.logfox.R
import com.f0x1d.logfox.database.AppCrash
import com.f0x1d.logfox.receiver.CopyReceiver
import com.f0x1d.logfox.ui.activity.CrashDetailsActivity
import com.f0x1d.logfox.utils.pendingIntentFlags

fun Context.sendErrorNotification(appCrash: AppCrash, hasContentIntent: Boolean) = notificationManagerCompat.notify(
appCrash.packageName,
Expand All @@ -36,18 +34,6 @@ fun Context.sendErrorNotification(appCrash: AppCrash, hasContentIntent: Boolean)
CopyReceiver.EXTRA_NOTIFICATION_ID to appCrash.dateAndTime.toInt()
))
)
.apply {
if (isOmnibinInstalled()) addAction(
R.drawable.ic_add_link,
getString(R.string.omnibin),
PendingIntent.getActivity(
this@sendErrorNotification,
-4,
uploadToFoxBinIntent(appCrash.log),
pendingIntentFlags
)
)
}
.build()
)

Expand Down
26 changes: 0 additions & 26 deletions app/src/main/java/com/f0x1d/logfox/extensions/OmnibinExtensions.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,22 @@ class CrashDetailsActivity: BaseViewModelActivity<CrashDetailsViewModel, Activit
binding.logCard.applyBottomInsets(window.decorView)

binding.toolbar.setNavigationOnClickListener {
onBackPressed()
onBackPressedDispatcher.onBackPressed()
}

viewModel.data.observe(this) {
setupFor(it ?: return@observe)
}

viewModel.uploadingStateData.observe(this) {
binding.omnibinLayout.isEnabled = !it
binding.foxbinLayout.isEnabled = !it

binding.omnibinImage.visibility = if (it) View.INVISIBLE else View.VISIBLE
binding.omnibinText.visibility = if (it) View.INVISIBLE else View.VISIBLE
(if (it) View.INVISIBLE else View.VISIBLE).also { visibility ->
binding.foxbinImage.visibility = visibility
binding.foxbinText.visibility = visibility
}

binding.omnibinLoadingProgress.visibility = if (it) View.VISIBLE else View.INVISIBLE
binding.foxbinLoadingProgress.visibility = if (it) View.VISIBLE else View.INVISIBLE
}
}

Expand Down Expand Up @@ -90,15 +92,9 @@ class CrashDetailsActivity: BaseViewModelActivity<CrashDetailsViewModel, Activit
shareIntent(appCrash.log)
}

binding.omnibinLayout.setOnClickListener {
appCrash.log.apply {
if (isOmnibinInstalled())
uploadToFoxBin(this)
else
viewModel.uploadCrash(this)
}
binding.foxbinLayout.setOnClickListener {
viewModel.uploadCrash(appCrash.log)
}
binding.omnibinText.setText(if (isOmnibinInstalled()) R.string.omnibin else R.string.foxbin)

binding.zipLayout.setOnClickListener {
zipCrashLauncher.launch("crash-${appCrash.packageName.replace(".", "-")}-${appCrash.dateAndTime.exportFormatted}.zip")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.f0x1d.logfox.ui.fragment.settings

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.navigation.fragment.findNavController
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import com.f0x1d.logfox.R
import com.f0x1d.logfox.extensions.isOmnibinInstalled
import com.f0x1d.logfox.ui.fragment.settings.base.BaseSettingsWrapperFragment
import dagger.hilt.android.AndroidEntryPoint

Expand Down Expand Up @@ -38,15 +35,6 @@ class SettingsMenuFragment: BaseSettingsWrapperFragment() {
findNavController().navigate(SettingsMenuFragmentDirections.actionSettingsMenuFragmentToSettingsNotificationsFragment())
return@setOnPreferenceClickListener true
}

findPreference<Preference>("pref_omnibin_integration")?.setOnPreferenceClickListener {
startActivity(if (requireContext().isOmnibinInstalled())
requireContext().packageManager.getLaunchIntentForPackage("com.f0x1d.dogbin")
else
Intent(Intent.ACTION_VIEW).setData(Uri.parse("https://play.google.com/store/apps/details?id=com.f0x1d.dogbin"))
)
return@setOnPreferenceClickListener true
}
}
}
}
8 changes: 0 additions & 8 deletions app/src/main/res/drawable/ic_settings_omnibin.xml

This file was deleted.

22 changes: 11 additions & 11 deletions app/src/main/res/layout/activity_crash_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
android:clickable="true"
android:focusable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/omnibin_layout"
app:layout_constraintEnd_toStartOf="@id/foxbin_layout"
app:layout_constraintStart_toEndOf="@id/copy_layout"
app:layout_constraintTop_toTopOf="parent">

Expand Down Expand Up @@ -175,7 +175,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/omnibin_layout"
android:id="@+id/foxbin_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
Expand All @@ -187,25 +187,25 @@
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:id="@+id/omnibin_image"
android:id="@+id/foxbin_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_add_link"
app:tint="?colorPrimary"
android:layout_marginTop="15dp"
app:layout_constraintBottom_toTopOf="@id/omnibin_text"
app:layout_constraintEnd_toEndOf="@id/omnibin_text"
app:layout_constraintStart_toStartOf="@id/omnibin_text"
app:layout_constraintBottom_toTopOf="@id/foxbin_text"
app:layout_constraintEnd_toEndOf="@id/foxbin_text"
app:layout_constraintStart_toStartOf="@id/foxbin_text"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/omnibin_text"
android:id="@+id/foxbin_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:text="@string/omnibin"
android:text="@string/foxbin"
android:textColor="?colorPrimary"
android:textSize="14sp"
android:textStyle="bold"
Expand All @@ -214,10 +214,10 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/omnibin_image" />
app:layout_constraintTop_toBottomOf="@id/foxbin_image" />

<ProgressBar
android:id="@+id/omnibin_loading_progress"
android:id="@+id/foxbin_loading_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
Expand All @@ -237,7 +237,7 @@
android:focusable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/omnibin_layout"
app:layout_constraintStart_toEndOf="@id/foxbin_layout"
app:layout_constraintTop_toTopOf="parent">

<ImageView
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
<string name="collect_anr">Собирать ANR</string>
<string name="show_anr_notifications">Показывать уведомления о ANR</string>
<string name="error">Ошибка: %s</string>
<string name="integrations">Интеграции</string>
<string name="omnibin_integration_desc">Легко просматривайте и управляйте вашими записями</string>
<string name="log_levels">Уровни логов</string>
<string name="tag">Тэг</string>
<string name="content_contains">Текст содержит</string>
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<string name="delete">Delete</string>
<string name="resume">Resume</string>
<string name="foxbin" translatable="false">foxbin</string>
<string name="omnibin" translatable="false">omnibin</string>
<string name="ui" translatable="false">UI</string>
<string name="logs_update_interval">Logs update interval</string>
<string name="in_ms">In ms</string>
Expand All @@ -49,8 +48,6 @@
<string name="collect_anr">Collect ANR</string>
<string name="show_anr_notifications">Show ANR notifications</string>
<string name="error">Error: %s</string>
<string name="integrations">Integrations</string>
<string name="omnibin_integration_desc">Easily view and manage your pastes</string>
<string name="log_levels">Log levels</string>
<string name="pid" translatable="false">PID</string>
<string name="tid" translatable="false">TID</string>
Expand Down
12 changes: 0 additions & 12 deletions app/src/main/res/xml/settings_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@
android:icon="@drawable/ic_settings_notifications" />
</PreferenceCategory>

<PreferenceCategory
android:title="@string/integrations"
app:iconSpaceReserved="false"
app:allowDividerAbove="false">

<Preference
android:title="@string/omnibin"
android:summary="@string/omnibin_integration_desc"
android:key="pref_omnibin_integration"
android:icon="@drawable/ic_settings_omnibin" />
</PreferenceCategory>

<PreferenceCategory
android:title="@string/about_app"
app:iconSpaceReserved="false"
Expand Down

0 comments on commit 8c21ac4

Please sign in to comment.