Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
What goes around, comes around

Sheeraz Ahmed Memon sheerazam

💭
What goes around, comes around
  • Constellation1 USA (Remote)
  • Pakistan
View GitHub Profile
@sheerazam
sheerazam / build.gradle
Created Nov 27, 2021
How to Parse Xml using Kotlin in 2021
View build.gradle
implementation group: 'org.simpleframework', name: 'simple-xml', version: '2.7.1'
@sheerazam
sheerazam / Exmple.xml
Created Nov 27, 2021
How to Parse Xml using Kotlin in 2021
View Exmple.xml
<?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 Nov 27, 2021
How to Parse Xml using Kotlin in 2021
View SimpleXmlTest.kt
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 Nov 27, 2021
How to Parse Xml using Kotlin in 2021
View Col.kt
@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 Nov 25, 2021
Implementing Force Update Feature using Firebase Remote Config in iOS
View AppDelegate.swift
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 Nov 25, 2021
Implementing Force Update Feature using Firebase Remote Config in iOS
View AppDelegate+Extensions.swift
//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 Nov 25, 2021
Implementing Force Update Feature using Firebase Remote Config in iOS
View UIViewController+UrlOpener.swift
//
// 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 Nov 25, 2021
Implementing Force Update Feature using Firebase Remote Config in iOS
View ForceUpdateChecker.swift
//
// 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 Mar 25, 2021
End to End Test using MockWebserver
View BaseUITest.kt
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 Oct 19, 2016
Creating Scroll Aware Fab
View ScrollAwareFABBehavior.java
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,