This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HorizontalMarginItemDecoration(context: Context, @DimenRes horizontalMarginInDp: Int) : | |
| RecyclerView.ItemDecoration() { | |
| private val horizontalMarginInPx: Int = | |
| context.resources.getDimension(horizontalMarginInDp).toInt() | |
| override fun getItemOffsets( | |
| outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State | |
| ) { | |
| outRect.right = horizontalMarginInPx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.annotation.SuppressLint | |
| import android.content.ContentUris | |
| import android.content.Context | |
| import android.database.Cursor | |
| import android.database.DatabaseUtils | |
| import android.net.Uri | |
| import android.os.Build | |
| import android.os.Environment | |
| import android.provider.DocumentsContract | |
| import android.provider.MediaStore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Composable | |
| fun image(data: Any):Image? { | |
| // Positionally memoize the request creation so | |
| // it will only be recreated if data changes. | |
| val request = remember(data) { | |
| Coil.loader().newGetBuilder().data(data).build() | |
| } | |
| return image(request) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle | |
| import android.util.Log | |
| import android.view.ViewGroup | |
| import android.widget.TextView | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.databinding.DataBindingUtil | |
| import androidx.lifecycle.Lifecycle | |
| import androidx.lifecycle.LifecycleObserver | |
| import androidx.lifecycle.OnLifecycleEvent | |
| import app.keima.android.recyclerviewsandbox.databinding.ActivityMainBinding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_followers(browser, | |
| username, | |
| grab, | |
| relationship_data, | |
| live_match, | |
| store_locally, | |
| logger, | |
| logfolder): | |
| """ Get entire list of followers using graphql queries. """ | |
| if username not in relationship_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open class BaseAdapter<T>(diffcallback: DiffUtil.ItemCallback<T>) : PagedListAdapter<T, BaseViewHolder>(diffcallback) { | |
| protected val delegateManager: DelegateManager<T> = DelegateManager() | |
| protected fun useItemViewDelegateManager(): Boolean = delegateManager.delegateCount > 0 | |
| override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder = | |
| BaseViewHolder.createHolder(delegateManager.getItemViewDelegate(viewType).itemViewLayoutView) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function getTimelineFeed( | |
| $maxId = null, | |
| array $options = null) | |
| { | |
| $request = $this->ig->request('feed/timeline/') | |
| ->setSignedPost(false) | |
| ->addHeader('X-Ads-Opt-Out', '0') | |
| ->addHeader('X-Google-AD-ID', $this->ig->advertising_id) | |
| ->addHeader('X-DEVICE-ID', $this->ig->uuid) | |
| ->addPost('_csrftoken', $this->ig->client->getToken()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| com.android.dx.cf.code.SimException: local 0005: invalid | |
| at com.android.dx.cf.code.OneLocalsArray.throwSimException(OneLocalsArray.java:243) | |
| at com.android.dx.cf.code.OneLocalsArray.get(OneLocalsArray.java:155) | |
| at com.android.dx.cf.code.BaseMachine.localArg(BaseMachine.java:211) | |
| at com.android.dx.cf.code.Simulator$SimVisitor.visitLocal(Simulator.java:604) | |
| at com.android.dx.cf.code.BytecodeArray.parseInstruction(BytecodeArray.java:368) | |
| at com.android.dx.cf.code.Simulator.simulate(Simulator.java:103) | |
| at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:790) | |
| at com.android.dx.cf.code.Ropper.doit(Ropper.java:745) | |
| at com.android.dx.cf.code.Ropper.convert(Ropper.java:350) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.HashMap | |
| class CookieJar(vararg val cookies: Cookie = arrayOf()) : MutableMap<String, String> by (cookies.associate { it.key to it.valueWithAttributes } as HashMap<String, String>) { | |
| companion object { | |
| private fun Map<String, Any>.toCookieArray(): Array<Cookie> { | |
| return this.map { | |
| val valueList = it.value.toString().split(";").map(String::trim) | |
| val value = valueList[0] | |
| val attributes = if (valueList.size < 2) mapOf<String, String>() else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ApiResponse<T> { | |
| private static final Pattern LINK_PATTERN = Pattern | |
| .compile("<([^>]*)>[\\s]*;[\\s]*rel=\"([a-zA-Z0-9]+)\""); | |
| private static final Pattern PAGE_PATTERN = Pattern.compile("page=(\\d)+"); | |
| private static final String NEXT_LINK = "next"; | |
| public final int code; | |
| @Nullable | |
| public final T body; | |
| @Nullable | |
| public final String errorMessage; |
NewerOlder