From 05112dc8fb52478c7ee03265f2feb67acd30ce66 Mon Sep 17 00:00:00 2001 From: Volodymyr Buberenko Date: Sat, 25 Jan 2020 21:30:54 +0200 Subject: [PATCH 01/12] Remove ltr forcing and replace ScrollView in Overview --- library/src/main/res/layout/chucker_activity_error.xml | 1 - library/src/main/res/layout/chucker_activity_main.xml | 1 - library/src/main/res/layout/chucker_activity_transaction.xml | 1 - library/src/main/res/layout/chucker_fragment_error_list.xml | 1 - .../main/res/layout/chucker_fragment_transaction_list.xml | 1 - .../res/layout/chucker_fragment_transaction_overview.xml | 5 ++--- .../main/res/layout/chucker_fragment_transaction_payload.xml | 1 - library/src/main/res/layout/chucker_list_item_error.xml | 1 - .../src/main/res/layout/chucker_list_item_transaction.xml | 1 - 9 files changed, 2 insertions(+), 11 deletions(-) diff --git a/library/src/main/res/layout/chucker_activity_error.xml b/library/src/main/res/layout/chucker_activity_error.xml index 069240d26..ee35c4946 100644 --- a/library/src/main/res/layout/chucker_activity_error.xml +++ b/library/src/main/res/layout/chucker_activity_error.xml @@ -20,7 +20,6 @@ android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" - android:layoutDirection="ltr" tools:context="com.chuckerteam.chucker.internal.ui.error.ErrorActivity"> - - + diff --git a/library/src/main/res/layout/chucker_fragment_transaction_payload.xml b/library/src/main/res/layout/chucker_fragment_transaction_payload.xml index 6bf2d5191..2edbe2847 100755 --- a/library/src/main/res/layout/chucker_fragment_transaction_payload.xml +++ b/library/src/main/res/layout/chucker_fragment_transaction_payload.xml @@ -5,7 +5,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:animateLayoutChanges="true" - android:layoutDirection="ltr" tools:context="com.chuckerteam.chucker.internal.ui.transaction.TransactionPayloadFragment"> Date: Sat, 25 Jan 2020 22:30:20 +0200 Subject: [PATCH 02/12] Replace Overview layout, add rtl support for it --- library/src/main/AndroidManifest.xml | 3 +- .../chucker_fragment_transaction_overview.xml | 512 +++++++++--------- library/src/main/res/values-v21/styles.xml | 21 +- library/src/main/res/values/styles.xml | 1 - 4 files changed, 275 insertions(+), 262 deletions(-) diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml index 0f59bd9e1..863a3bbc9 100644 --- a/library/src/main/AndroidManifest.xml +++ b/library/src/main/AndroidManifest.xml @@ -16,7 +16,8 @@ --> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/library/src/main/res/values-v21/styles.xml b/library/src/main/res/values-v21/styles.xml index e5b1cb3d8..9eab9114c 100644 --- a/library/src/main/res/values-v21/styles.xml +++ b/library/src/main/res/values-v21/styles.xml @@ -14,14 +14,33 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + + + + + \ No newline at end of file diff --git a/library/src/main/res/values/styles.xml b/library/src/main/res/values/styles.xml index dd14451a0..cd60ea5f1 100644 --- a/library/src/main/res/values/styles.xml +++ b/library/src/main/res/values/styles.xml @@ -40,7 +40,6 @@ From 45ece864cf75b742a2dea48b684ec4c94de46faf Mon Sep 17 00:00:00 2001 From: Volodymyr Buberenko Date: Sat, 25 Jan 2020 22:52:51 +0200 Subject: [PATCH 03/12] Add textDirection and textAlignment property for API 21+ --- library/build.gradle | 1 + .../drawable/chucker_ic_https_grey_24dp.xml | 2 +- .../layout/chucker_list_item_transaction.xml | 3 +-- library/src/main/res/values-v21/styles.xml | 24 ++++++++++++------- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 98a1ac3b7..5c3d4ccd2 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -16,6 +16,7 @@ android { versionName VERSION_NAME versionCode VERSION_CODE.toInteger() consumerProguardFiles 'proguard-rules.pro' + vectorDrawables.useSupportLibrary = true } kotlinOptions { diff --git a/library/src/main/res/drawable/chucker_ic_https_grey_24dp.xml b/library/src/main/res/drawable/chucker_ic_https_grey_24dp.xml index 8ffd1fdd8..171538e8c 100644 --- a/library/src/main/res/drawable/chucker_ic_https_grey_24dp.xml +++ b/library/src/main/res/drawable/chucker_ic_https_grey_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/library/src/main/res/layout/chucker_list_item_transaction.xml b/library/src/main/res/layout/chucker_list_item_transaction.xml index 8338fcc97..7da1e7b8c 100644 --- a/library/src/main/res/layout/chucker_list_item_transaction.xml +++ b/library/src/main/res/layout/chucker_list_item_transaction.xml @@ -53,9 +53,8 @@ android:layout_width="@dimen/chucker_doub_grid" android:layout_height="@dimen/chucker_doub_grid" android:contentDescription="@string/chucker_ssl" - android:src="@drawable/chucker_ic_https_grey_24dp" - android:tint="@color/chucker_color_primary" android:visibility="gone" + app:srcCompat="@drawable/chucker_ic_https_grey_24dp" app:layout_constraintStart_toStartOf="@+id/chucker_path" app:layout_constraintTop_toBottomOf="@+id/chucker_path" tools:visibility="visible" /> diff --git a/library/src/main/res/values-v21/styles.xml b/library/src/main/res/values-v21/styles.xml index 9eab9114c..2d1973855 100644 --- a/library/src/main/res/values-v21/styles.xml +++ b/library/src/main/res/values-v21/styles.xml @@ -15,31 +15,39 @@ ~ limitations under the License. --> + + From 3bca5b492b3ba377d949ea25c91343444411947b Mon Sep 17 00:00:00 2001 From: Volodymyr Buberenko Date: Sat, 15 Feb 2020 00:40:52 +0200 Subject: [PATCH 04/12] Fix host textview constraints --- .../src/main/res/layout/chucker_list_item_transaction.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/res/layout/chucker_list_item_transaction.xml b/library/src/main/res/layout/chucker_list_item_transaction.xml index 00a5ae80c..15b3204d8 100644 --- a/library/src/main/res/layout/chucker_list_item_transaction.xml +++ b/library/src/main/res/layout/chucker_list_item_transaction.xml @@ -40,10 +40,9 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="@dimen/chucker_half_grid" - app:layout_constraintBottom_toBottomOf="@+id/ssl" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/ssl" - app:layout_constraintTop_toTopOf="@+id/ssl" + app:layout_constraintTop_toBottomOf="@+id/path" app:layout_goneMarginStart="0dp" app:layout_goneMarginTop="@dimen/chucker_doub_grid" tools:text="example.com" /> @@ -56,7 +55,8 @@ android:src="@drawable/chucker_ic_https_primary" android:visibility="gone" app:layout_constraintStart_toStartOf="@+id/path" - app:layout_constraintTop_toBottomOf="@+id/path" + app:layout_constraintTop_toTopOf="@+id/host" + app:layout_constraintBottom_toBottomOf="@id/host" tools:visibility="visible" /> Date: Sat, 15 Feb 2020 00:52:17 +0200 Subject: [PATCH 05/12] Replace android:src with app:srcCompat --- library/src/main/res/layout/chucker_list_item_transaction.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/res/layout/chucker_list_item_transaction.xml b/library/src/main/res/layout/chucker_list_item_transaction.xml index 15b3204d8..5bc56cb4d 100644 --- a/library/src/main/res/layout/chucker_list_item_transaction.xml +++ b/library/src/main/res/layout/chucker_list_item_transaction.xml @@ -52,11 +52,11 @@ android:layout_width="@dimen/chucker_doub_grid" android:layout_height="@dimen/chucker_doub_grid" android:contentDescription="@string/chucker_ssl" - android:src="@drawable/chucker_ic_https_primary" android:visibility="gone" app:layout_constraintStart_toStartOf="@+id/path" app:layout_constraintTop_toTopOf="@+id/host" app:layout_constraintBottom_toBottomOf="@id/host" + app:srcCompat="@drawable/chucker_ic_https_primary" tools:visibility="visible" /> Date: Sat, 22 Feb 2020 18:33:36 +0200 Subject: [PATCH 06/12] Update ids for layouts to avoid clashes --- .../chucker/internal/ui/MainActivity.kt | 6 +- .../internal/ui/error/ErrorActivity.kt | 14 +-- .../chucker/internal/ui/error/ErrorAdapter.kt | 8 +- .../internal/ui/error/ErrorListFragment.kt | 6 +- .../ui/transaction/TransactionActivity.kt | 8 +- .../ui/transaction/TransactionAdapter.kt | 14 +-- .../ui/transaction/TransactionListFragment.kt | 6 +- .../TransactionOverviewFragment.kt | 24 ++-- .../transaction/TransactionPayloadAdapter.kt | 6 +- .../transaction/TransactionPayloadFragment.kt | 12 +- .../res/layout/chucker_activity_error.xml | 12 +- .../main/res/layout/chucker_activity_main.xml | 9 +- .../layout/chucker_activity_transaction.xml | 14 +-- .../layout/chucker_fragment_error_list.xml | 6 +- .../chucker_fragment_transaction_list.xml | 6 +- .../chucker_fragment_transaction_overview.xml | 119 +++++++++--------- .../chucker_fragment_transaction_payload.xml | 4 +- .../res/layout/chucker_list_item_error.xml | 8 +- .../layout/chucker_list_item_transaction.xml | 44 +++---- .../chucker_transaction_item_body_line.xml | 2 +- .../chucker_transaction_item_headers.xml | 2 +- .../layout/chucker_transaction_item_image.xml | 2 +- 22 files changed, 163 insertions(+), 169 deletions(-) diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/MainActivity.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/MainActivity.kt index b85345213..42ab63be6 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/MainActivity.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/MainActivity.kt @@ -28,16 +28,16 @@ internal class MainActivity : super.onCreate(savedInstanceState) setContentView(R.layout.chucker_activity_main) - val toolbar = findViewById(R.id.toolbar) + val toolbar = findViewById(R.id.chuckerTransactionToolbar) setSupportActionBar(toolbar) toolbar.subtitle = applicationName viewModel = ViewModelProvider(this).get(MainViewModel::class.java) - viewPager = findViewById(R.id.viewPager) + viewPager = findViewById(R.id.chuckerMainViewPager) viewPager.adapter = HomePageAdapter(this, supportFragmentManager) - val tabLayout = findViewById(R.id.tabLayout) + val tabLayout = findViewById(R.id.chuckerMainTabLayout) tabLayout.setupWithViewPager(viewPager) viewPager.addOnPageChangeListener(object : TabLayout.TabLayoutOnPageChangeListener(tabLayout) { diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorActivity.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorActivity.kt index 0f87836e2..bffd62fea 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorActivity.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorActivity.kt @@ -30,15 +30,15 @@ internal class ErrorActivity : BaseChuckerActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.chucker_activity_error) - setSupportActionBar(findViewById(R.id.toolbar)) + setSupportActionBar(findViewById(R.id.chuckerErrorToolbar)) supportActionBar?.setDisplayHomeAsUpEnabled(true) - title = findViewById(R.id.toolbar_title) - tag = findViewById(R.id.tag) - clazz = findViewById(R.id.clazz) - message = findViewById(R.id.message) - date = findViewById(R.id.date) - stacktrace = findViewById(R.id.stacktrace) + title = findViewById(R.id.chuckerErrorToolbarTitle) + tag = findViewById(R.id.chuckerItemErrorTag) + clazz = findViewById(R.id.chuckerItemErrorClazz) + message = findViewById(R.id.chuckerItemErrorMessage) + date = findViewById(R.id.chuckerItemErrorDate) + stacktrace = findViewById(R.id.chuckerErrorStacktrace) date.visibility = View.GONE throwableId = intent.getLongExtra(EXTRA_THROWABLE_ID, 0) diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorAdapter.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorAdapter.kt index 4b4c1ed6a..330683f03 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorAdapter.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorAdapter.kt @@ -40,10 +40,10 @@ internal class ErrorAdapter( itemView: View ) : RecyclerView.ViewHolder(itemView), View.OnClickListener { - private val tagView: TextView = itemView.findViewById(R.id.tag) - private val clazzView: TextView = itemView.findViewById(R.id.clazz) - private val messageView: TextView = itemView.findViewById(R.id.message) - private val dateView: TextView = itemView.findViewById(R.id.date) + private val tagView: TextView = itemView.findViewById(R.id.chuckerItemErrorTag) + private val clazzView: TextView = itemView.findViewById(R.id.chuckerItemErrorClazz) + private val messageView: TextView = itemView.findViewById(R.id.chuckerItemErrorMessage) + private val dateView: TextView = itemView.findViewById(R.id.chuckerItemErrorDate) private var throwableId: Long? = null init { diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorListFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorListFragment.kt index a7fd06e42..469895a6c 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorListFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorListFragment.kt @@ -35,10 +35,10 @@ internal class ErrorListFragment : Fragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { return inflater.inflate(R.layout.chucker_fragment_error_list, container, false).apply { - tutorialView = findViewById(R.id.tutorial) - findViewById(R.id.link).movementMethod = LinkMovementMethod.getInstance() + tutorialView = findViewById(R.id.chuckerErrorsTutorialView) + findViewById(R.id.chuckerErrorsTutorialLink).movementMethod = LinkMovementMethod.getInstance() - val recyclerView = findViewById(R.id.list) + val recyclerView = findViewById(R.id.chuckerErrorsRecyclerView) recyclerView.addItemDecoration(DividerItemDecoration(context, VERTICAL)) adapter = ErrorAdapter(listener) recyclerView.adapter = adapter diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionActivity.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionActivity.kt index a8cb99c45..743d351e1 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionActivity.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionActivity.kt @@ -33,15 +33,15 @@ internal class TransactionActivity : BaseChuckerActivity() { viewModel = ViewModelProvider(this, TransactionViewModelFactory(transactionId)) .get(TransactionViewModel::class.java) - val toolbar = findViewById(R.id.toolbar) + val toolbar = findViewById(R.id.chuckerTransactionToolbar) setSupportActionBar(toolbar) - title = findViewById(R.id.toolbar_title) + title = findViewById(R.id.chuckerTransactionToolbarTitle) supportActionBar?.setDisplayHomeAsUpEnabled(true) - findViewById(R.id.viewpager)?.let { viewPager -> + findViewById(R.id.chuckerTransactionViewPager)?.let { viewPager -> setupViewPager(viewPager) - findViewById(R.id.tabs).setupWithViewPager(viewPager) + findViewById(R.id.chuckerTransactionTabLayout).setupWithViewPager(viewPager) } } diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionAdapter.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionAdapter.kt index 79cf7d160..b1ca3db33 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionAdapter.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionAdapter.kt @@ -46,13 +46,13 @@ internal class TransactionAdapter internal constructor( } inner class ViewHolder(val view: View) : RecyclerView.ViewHolder(view) { - private val code: TextView = view.findViewById(R.id.code) - private val path: TextView = view.findViewById(R.id.path) - private val host: TextView = view.findViewById(R.id.host) - private val start: TextView = view.findViewById(R.id.time_start) - private val duration: TextView = view.findViewById(R.id.duration) - private val size: TextView = view.findViewById(R.id.size) - private val ssl: ImageView = view.findViewById(R.id.ssl) + private val code: TextView = view.findViewById(R.id.chuckerTransactionItemCode) + private val path: TextView = view.findViewById(R.id.chuckerTransactionItemPath) + private val host: TextView = view.findViewById(R.id.chuckerTransactionItemHost) + private val start: TextView = view.findViewById(R.id.chuckerTransactionItemTimeStart) + private val duration: TextView = view.findViewById(R.id.chuckerTransactionItemDuration) + private val size: TextView = view.findViewById(R.id.chuckerTransactionItemSize) + private val ssl: ImageView = view.findViewById(R.id.chuckerTransactionItemSsl) @SuppressLint("SetTextI18n") fun bind(transaction: HttpTransactionTuple) { diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt index 5d455cd47..2ef349b16 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt @@ -40,10 +40,10 @@ internal class TransactionListFragment : savedInstanceState: Bundle? ): View? { val view = inflater.inflate(R.layout.chucker_fragment_transaction_list, container, false) - tutorialView = view.findViewById(R.id.tutorial) - view.findViewById(R.id.link).movementMethod = LinkMovementMethod.getInstance() + tutorialView = view.findViewById(R.id.chuckerTransactionsTutorialView) + view.findViewById(R.id.chuckerTransactionsLink).movementMethod = LinkMovementMethod.getInstance() - val recyclerView = view.findViewById(R.id.list) + val recyclerView = view.findViewById(R.id.chuckerTransactionsRecyclerView) val context = view.context recyclerView.addItemDecoration( DividerItemDecoration(context, DividerItemDecoration.VERTICAL) diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionOverviewFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionOverviewFragment.kt index 1fc6039f9..f678689a6 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionOverviewFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionOverviewFragment.kt @@ -41,18 +41,18 @@ internal class TransactionOverviewFragment : Fragment() { ): View? = inflater.inflate(R.layout.chucker_fragment_transaction_overview, container, false) .also { - url = it.findViewById(R.id.url) - method = it.findViewById(R.id.method) - protocol = it.findViewById(R.id.protocol) - status = it.findViewById(R.id.status) - response = it.findViewById(R.id.response) - ssl = it.findViewById(R.id.ssl) - requestTime = it.findViewById(R.id.request_time) - responseTime = it.findViewById(R.id.response_time) - duration = it.findViewById(R.id.duration) - requestSize = it.findViewById(R.id.request_size) - responseSize = it.findViewById(R.id.response_size) - totalSize = it.findViewById(R.id.total_size) + url = it.findViewById(R.id.chuckerTransactionOverviewUrl) + method = it.findViewById(R.id.chuckerTransactionOverviewMethod) + protocol = it.findViewById(R.id.chuckerTransactionOverviewProtocol) + status = it.findViewById(R.id.chuckerTransactionOverviewStatus) + response = it.findViewById(R.id.chuckerTransactionOverviewResponse) + ssl = it.findViewById(R.id.chuckerTransactionOverviewSsl) + requestTime = it.findViewById(R.id.chuckerTransactionOverviewRequestTime) + responseTime = it.findViewById(R.id.chuckerTransactionOverviewResponseTime) + duration = it.findViewById(R.id.chuckerTransactionOverviewDuration) + requestSize = it.findViewById(R.id.chuckerTransactionOverviewRequestSize) + responseSize = it.findViewById(R.id.chuckerTransactionOverviewResponseSize) + totalSize = it.findViewById(R.id.chuckerTransactionOverviewTotalSize) } override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadAdapter.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadAdapter.kt index bfbefe095..8b8698b48 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadAdapter.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadAdapter.kt @@ -96,7 +96,7 @@ internal sealed class TransactionPayloadViewHolder(view: View) : RecyclerView.Vi abstract fun bind(item: TransactionPayloadItem) internal class HeaderViewHolder(view: View) : TransactionPayloadViewHolder(view) { - private val headersView: TextView = view.findViewById(R.id.headers) + private val headersView: TextView = view.findViewById(R.id.chuckerTransactionResponseHeaders) override fun bind(item: TransactionPayloadItem) { if (item is TransactionPayloadItem.HeaderItem) { headersView.text = item.headers @@ -105,7 +105,7 @@ internal sealed class TransactionPayloadViewHolder(view: View) : RecyclerView.Vi } internal class BodyLineViewHolder(view: View) : TransactionPayloadViewHolder(view) { - private val bodyLineView: TextView = view.findViewById(R.id.body_line) + private val bodyLineView: TextView = view.findViewById(R.id.chuckerTransactionResponseBodyLine) override fun bind(item: TransactionPayloadItem) { if (item is TransactionPayloadItem.BodyLineItem) { bodyLineView.text = item.line @@ -114,7 +114,7 @@ internal sealed class TransactionPayloadViewHolder(view: View) : RecyclerView.Vi } internal class ImageViewHolder(view: View) : TransactionPayloadViewHolder(view) { - private val binaryDataView: ImageView = view.findViewById(R.id.binary_data) + private val binaryDataView: ImageView = view.findViewById(R.id.chuckerTransactionResponseBinaryData) override fun bind(item: TransactionPayloadItem) { if (item is TransactionPayloadItem.ImageItem) { binaryDataView.setImageBitmap(item.image) diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt index 93312550e..ad219a5db 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt @@ -61,9 +61,9 @@ internal class TransactionPayloadFragment : savedInstanceState: Bundle? ): View? = inflater.inflate(R.layout.chucker_fragment_transaction_payload, container, false).apply { - transactionContentList = findViewById(R.id.transaction_content) + transactionContentList = findViewById(R.id.chuckerTransactionResponseRecyclerView) transactionContentList.isNestedScrollingEnabled = false - progressLoading = findViewById(R.id.progress_loading_transaction) + progressLoading = findViewById(R.id.chuckerTransactionLoadingProgress) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -182,8 +182,8 @@ internal class TransactionPayloadFragment : AsyncTask, Unit, List>() { override fun onPreExecute() { - val progressBar: ProgressBar? = fragment.view?.findViewById(R.id.progress_loading_transaction) - val recyclerView: RecyclerView? = fragment.view?.findViewById(R.id.transaction_content) + val progressBar: ProgressBar? = fragment.view?.findViewById(R.id.chuckerTransactionLoadingProgress) + val recyclerView: RecyclerView? = fragment.view?.findViewById(R.id.chuckerTransactionResponseRecyclerView) progressBar?.visibility = View.VISIBLE recyclerView?.visibility = View.INVISIBLE } @@ -233,8 +233,8 @@ internal class TransactionPayloadFragment : } override fun onPostExecute(result: List) { - val progressBar: ProgressBar? = fragment.view?.findViewById(R.id.progress_loading_transaction) - val recyclerView: RecyclerView? = fragment.view?.findViewById(R.id.transaction_content) + val progressBar: ProgressBar? = fragment.view?.findViewById(R.id.chuckerTransactionLoadingProgress) + val recyclerView: RecyclerView? = fragment.view?.findViewById(R.id.chuckerTransactionResponseRecyclerView) progressBar?.visibility = View.INVISIBLE recyclerView?.visibility = View.VISIBLE recyclerView?.adapter = TransactionBodyAdapter(result) diff --git a/library/src/main/res/layout/chucker_activity_error.xml b/library/src/main/res/layout/chucker_activity_error.xml index 5cf44ddd1..3ea75ce3e 100644 --- a/library/src/main/res/layout/chucker_activity_error.xml +++ b/library/src/main/res/layout/chucker_activity_error.xml @@ -2,32 +2,30 @@ - - + @@ -39,7 +37,7 @@ app:layout_behavior="@string/appbar_scrolling_view_behavior"> - @@ -26,7 +25,7 @@ diff --git a/library/src/main/res/layout/chucker_activity_transaction.xml b/library/src/main/res/layout/chucker_activity_transaction.xml index 6c9114a57..73b3b9e7b 100644 --- a/library/src/main/res/layout/chucker_activity_transaction.xml +++ b/library/src/main/res/layout/chucker_activity_transaction.xml @@ -2,35 +2,33 @@ - - + @@ -38,7 +36,7 @@ diff --git a/library/src/main/res/layout/chucker_fragment_error_list.xml b/library/src/main/res/layout/chucker_fragment_error_list.xml index 2b2ae9e71..51b21faba 100644 --- a/library/src/main/res/layout/chucker_fragment_error_list.xml +++ b/library/src/main/res/layout/chucker_fragment_error_list.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent"> @@ -43,18 +43,18 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:text="@string/chucker_method" - app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintEnd_toStartOf="@id/chuckerTransactionOverviewGuideline" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/url" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewUrl" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewMethod" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewProtocol" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewStatus" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewResponse" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewSsl" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewRequestTime" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewResponseTime" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewDuration" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewRequestSize" /> + app:layout_constraintTop_toBottomOf="@id/chuckerTransactionOverviewResponseSize" /> - \ No newline at end of file diff --git a/library/src/main/res/layout/chucker_fragment_transaction_payload.xml b/library/src/main/res/layout/chucker_fragment_transaction_payload.xml index 220d55a75..842d46d4d 100755 --- a/library/src/main/res/layout/chucker_fragment_transaction_payload.xml +++ b/library/src/main/res/layout/chucker_fragment_transaction_payload.xml @@ -8,7 +8,7 @@ tools:context="com.chuckerteam.chucker.internal.ui.transaction.TransactionPayloadFragment"> \ No newline at end of file diff --git a/library/src/main/res/layout/chucker_transaction_item_body_line.xml b/library/src/main/res/layout/chucker_transaction_item_body_line.xml index bb01550a5..2d12da4ff 100644 --- a/library/src/main/res/layout/chucker_transaction_item_body_line.xml +++ b/library/src/main/res/layout/chucker_transaction_item_body_line.xml @@ -1,6 +1,6 @@ Date: Sat, 22 Feb 2020 18:41:34 +0200 Subject: [PATCH 07/12] Update Material components to stable --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c23cc5415..a70108dfa 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { // Google libraries appCompatVersion = '1.1.0' constraintLayoutVersion = '1.1.3' - materialComponentsVersion = '1.1.0-rc02' + materialComponentsVersion = '1.1.0' roomVersion = '2.2.3' lifecycleVersion = '2.2.0' From 81b8c1d8bd82c18bafb4a567c086215f086e7aff Mon Sep 17 00:00:00 2001 From: Volodymyr Buberenko Date: Tue, 25 Feb 2020 10:57:40 +0200 Subject: [PATCH 08/12] Remove supportsRTL tag from Manifest, update Gradle plugin --- build.gradle | 2 +- gradle.properties | 2 ++ sample/src/main/AndroidManifest.xml | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index a70108dfa..a6f842479 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ buildscript { ext { kotlinVersion = '1.3.61' - androidGradleVersion = '3.5.3' + androidGradleVersion = '3.6.0' // Google libraries appCompatVersion = '1.1.0' diff --git a/gradle.properties b/gradle.properties index b5e75b03b..5f446eda8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,6 +16,8 @@ org.gradle.jvmargs=-Xmx1536m # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects org.gradle.parallel=true +android.useAndroidX=true + VERSION_NAME=3.1.2 # 3*100*100 + 1*100 + 2 => 30102 VERSION_CODE=30102 diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index f24579121..8cff3729f 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -9,7 +9,6 @@ android:allowBackup="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" - android:supportsRtl="true" android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning"> From fce27da4078f5f20e77859e48e4b6d7e186b4b79 Mon Sep 17 00:00:00 2001 From: Volodymyr Buberenko Date: Tue, 25 Feb 2020 12:28:52 +0200 Subject: [PATCH 09/12] Styles update --- library/src/main/res/values-v21/styles.xml | 35 ++-------------------- library/src/main/res/values/styles.xml | 29 +++++++++--------- 2 files changed, 17 insertions(+), 47 deletions(-) diff --git a/library/src/main/res/values-v21/styles.xml b/library/src/main/res/values-v21/styles.xml index f439470ff..9f0086f22 100644 --- a/library/src/main/res/values-v21/styles.xml +++ b/library/src/main/res/values-v21/styles.xml @@ -1,40 +1,9 @@ - + - - - - - - - - \ No newline at end of file diff --git a/library/src/main/res/values/styles.xml b/library/src/main/res/values/styles.xml index b3feba651..5beff4991 100644 --- a/library/src/main/res/values/styles.xml +++ b/library/src/main/res/values/styles.xml @@ -1,20 +1,22 @@ - + @@ -29,8 +31,7 @@ \ No newline at end of file From 5132ba16dcdd59ac02fdde3335e8d02bf148f22b Mon Sep 17 00:00:00 2001 From: Volodymyr Buberenko Date: Tue, 25 Feb 2020 12:30:48 +0200 Subject: [PATCH 10/12] Remove supportsRTL from library manifest --- library/src/main/AndroidManifest.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml index 1fc188f9c..23747160c 100644 --- a/library/src/main/AndroidManifest.xml +++ b/library/src/main/AndroidManifest.xml @@ -1,17 +1,18 @@ - + + + From ce4b6041d88e6640909ec8f2d85fba65478c69b4 Mon Sep 17 00:00:00 2001 From: Volodymyr Buberenko Date: Tue, 25 Feb 2020 23:20:54 +0200 Subject: [PATCH 11/12] Revert usage of supportVectorDrawables to avoid crashes on APIs 16-19 due to notifications icons --- library/build.gradle | 1 - library/src/main/res/drawable/chucker_ic_https_primary.xml | 2 +- library/src/main/res/layout/chucker_list_item_transaction.xml | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 4ecf83c2b..67854cc8c 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -16,7 +16,6 @@ android { versionName VERSION_NAME versionCode VERSION_CODE.toInteger() consumerProguardFiles 'proguard-rules.pro' - vectorDrawables.useSupportLibrary = true } kotlinOptions { diff --git a/library/src/main/res/drawable/chucker_ic_https_primary.xml b/library/src/main/res/drawable/chucker_ic_https_primary.xml index 171538e8c..84a041788 100644 --- a/library/src/main/res/drawable/chucker_ic_https_primary.xml +++ b/library/src/main/res/drawable/chucker_ic_https_primary.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/library/src/main/res/layout/chucker_list_item_transaction.xml b/library/src/main/res/layout/chucker_list_item_transaction.xml index cc4163bfd..b0da5e822 100644 --- a/library/src/main/res/layout/chucker_list_item_transaction.xml +++ b/library/src/main/res/layout/chucker_list_item_transaction.xml @@ -52,6 +52,7 @@ android:layout_width="@dimen/chucker_doub_grid" android:layout_height="@dimen/chucker_doub_grid" android:contentDescription="@string/chucker_ssl" + android:tint="@color/chucker_color_primary" android:visibility="gone" app:layout_constraintStart_toStartOf="@+id/chuckerTransactionItemPath" app:layout_constraintTop_toTopOf="@+id/chuckerTransactionItemHost" From b601b44d8d908e259d82056164b01a2b786de2d5 Mon Sep 17 00:00:00 2001 From: Volodymyr Buberenko Date: Tue, 25 Feb 2020 23:28:08 +0200 Subject: [PATCH 12/12] Fix lint issue with vector drawable --- library/src/main/res/layout/chucker_list_item_transaction.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/res/layout/chucker_list_item_transaction.xml b/library/src/main/res/layout/chucker_list_item_transaction.xml index b0da5e822..360d10c1b 100644 --- a/library/src/main/res/layout/chucker_list_item_transaction.xml +++ b/library/src/main/res/layout/chucker_list_item_transaction.xml @@ -52,12 +52,12 @@ android:layout_width="@dimen/chucker_doub_grid" android:layout_height="@dimen/chucker_doub_grid" android:contentDescription="@string/chucker_ssl" + android:src="@drawable/chucker_ic_https_primary" android:tint="@color/chucker_color_primary" android:visibility="gone" app:layout_constraintStart_toStartOf="@+id/chuckerTransactionItemPath" app:layout_constraintTop_toTopOf="@+id/chuckerTransactionItemHost" app:layout_constraintBottom_toBottomOf="@id/chuckerTransactionItemHost" - app:srcCompat="@drawable/chucker_ic_https_primary" tools:visibility="visible" />