Skip to content

Migrated widget module from Java to Kotlin #5940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.gson.Gson;

import fr.free.nrw.commons.actions.PageEditClient;
import fr.free.nrw.commons.explore.categories.CategoriesModule;
import fr.free.nrw.commons.navtab.MoreBottomSheetFragment;
import fr.free.nrw.commons.navtab.MoreBottomSheetLoggedOutFragment;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package fr.free.nrw.commons.widget

import android.app.Activity
import android.content.Context
import android.util.AttributeSet
import android.util.DisplayMetrics

import androidx.annotation.Nullable
import androidx.recyclerview.widget.RecyclerView


/**
* Created by Ilgaz Er on 8/7/2018.
*/
class HeightLimitedRecyclerView : RecyclerView {
private var height: Int = 0

constructor(context: Context) : super(context) {
initializeHeight(context)
}

constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
initializeHeight(context)
}

constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle) {
initializeHeight(context)
}

private fun initializeHeight(context: Context) {
val displayMetrics = DisplayMetrics()
(context as Activity).windowManager.defaultDisplay.getMetrics(displayMetrics)
height = displayMetrics.heightPixels
}

override fun onMeasure(widthSpec: Int, heightSpec: Int) {
val limitedHeightSpec = MeasureSpec.makeMeasureSpec(
(height * 0.3).toInt(),
MeasureSpec.AT_MOST
)
super.onMeasure(widthSpec, limitedHeightSpec)
}
}
181 changes: 0 additions & 181 deletions app/src/main/java/fr/free/nrw/commons/widget/PicOfDayAppWidget.java

This file was deleted.

Loading
Loading