Skip to content

Instantly share code, notes, and snippets.

View sheerazam's full-sized avatar

Sheeraz Ahmed Memon sheerazam

  • SSPA Sindh
  • Pakistan
View GitHub Profile
@sheerazam
sheerazam / build.gradle
Created November 27, 2021 12:50
How to Parse Xml using Kotlin in 2021
implementation group: 'org.simpleframework', name: 'simple-xml', version: '2.7.1'
@sheerazam
sheerazam / Exmple.xml
Created November 27, 2021 12:48
How to Parse Xml using Kotlin in 2021
<?xml version="1.0"?>
<!DOCTYPE DATA_FETCH SYSTEM "http://www.redata.com/Xml/DATA_FETCH.dtd">
<DATA_FETCH>
<REC>
<COL NAME="SELLER4_MOBILEPHONE" VALUE=""/>
<COL NAME="SELLER_EMAIL" VALUE=""/>
<COL NAME="SELLER_CITY" VALUE=""/>
<COL NAME="SELLER3_HOMEPHONE" VALUE=""/>
<COL NAME="SELLER4_FULLNAME" VALUE=""/>
<COL NAME="BUYER4_ADDRESS1" VALUE=""/>
@sheerazam
sheerazam / SimpleXmlTest.kt
Created November 27, 2021 12:38
How to Parse Xml using Kotlin in 2021
class SimpleXmlTest {
val xmlToParse = """
<?xml version="1.0"?>
<!DOCTYPE DATA_FETCH SYSTEM "http://www.redata.com/Xml/DATA_FETCH.dtd">
<DATA_FETCH>
<REC>
<COL NAME="SELLER4_MOBILEPHONE" VALUE=""/>
<COL NAME="SELLER_EMAIL" VALUE=""/>
<COL NAME="SELLER_CITY" VALUE=""/>
<COL NAME="SELLER3_HOMEPHONE" VALUE=""/>
@sheerazam
sheerazam / Col.kt
Created November 27, 2021 12:23
How to Parse Xml using Kotlin in 2021
@Root(strict = false, name = "COL")
class Col {
@field:Attribute(name = "NAME", required = false)
var name: String? = null
@field:Attribute(name = "VALUE", required = false)
var value: String? = null
}
@sheerazam
sheerazam / AppDelegate.swift
Created November 25, 2021 18:45
Implementing Force Update Feature using Firebase Remote Config in iOS
override func applicationDidBecomeActive(_ application: UIApplication) {
print("AppDelegate : application applicationDidBecomeActive()")
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
super.applicationDidBecomeActive(application)
//setup remote config
setupRemoteConfig()
ForceUpdateChecker(listener: self).check()
@sheerazam
sheerazam / AppDelegate+Extensions.swift
Created November 25, 2021 18:44
Implementing Force Update Feature using Firebase Remote Config in iOS
//Mark:- RemoteConfig Setup
extension MyAppDelegate {
func setupRemoteConfig(){
remoteConfig = RemoteConfig.remoteConfig()
remoteConfig.configSettings = RemoteConfigSettings(developerModeEnabled: true)!
//set in app defaults
let defaults : [String : Any] = [
ForceUpdateChecker.FORCE_UPDATE_REQUIRED : false,
@sheerazam
sheerazam / UIViewController+UrlOpener.swift
Created November 25, 2021 18:42
Implementing Force Update Feature using Firebase Remote Config in iOS
//
// UIViewController+UrlOpener.swift
// OutApp
//
// Created by Sheeraz Ahmed Memon on 23/06/2018.
// Copyright © 2018 SamSoft. All rights reserved.
//
import UIKit
extension UIViewController {
@sheerazam
sheerazam / ForceUpdateChecker.swift
Created November 25, 2021 18:40
Implementing Force Update Feature using Firebase Remote Config in iOS
//
// ForceUpdateChecker.swift
// OutApp
//
// Created by Sheeraz Ahmed Memon on 23/06/2018.
// Copyright © 2018 SamSoft. All rights reserved.
//
import Foundation
import Firebase
@sheerazam
sheerazam / BaseUITest.kt
Last active March 25, 2021 16:03
End to End Test using MockWebserver
import androidx.test.platform.app.InstrumentationRegistry
import okhttp3.mockwebserver.MockWebServer
import org.junit.After
import org.junit.Before
import org.koin.core.context.stopKoin
import org.koin.test.KoinTest
import java.io.BufferedReader
import java.io.Reader
abstract class BaseUITest : KoinTest {
@sheerazam
sheerazam / ScrollAwareFABBehavior.java
Last active October 19, 2016 12:09
Creating Scroll Aware Fab
public class ScrollAwareFABBehavior extends FloatingActionButton.Behavior {
private static final Interpolator INTERPOLATOR = new FastOutSlowInInterpolator();
private boolean mIsAnimatingOut = false;
public ScrollAwareFABBehavior(Context context, AttributeSet attrs) {
super();
}
@Override
public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,