This file contains 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 PaymentActivity : AppCompatActivity(), PaymentSheetResultCallback { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_payment) | |
val config = PaymentConfig( | |
amount = 100, | |
currency = "SAR", |
This file contains 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
val placeHolderImage = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Google_Map_Marker.svg/1024px-Google_Map_Marker.svg.png" | |
private var isMapLoaded = false | |
private var offers: MutableList<Product> = mutableListOf() | |
private var markers: MutableList<Marker> = mutableListOf() | |
// Your API success response | |
Status.SUCCESS -> { |
This file contains 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 PaymentController(private val context: Activity, private val order: Order) { | |
companion object { | |
private const val API_KEY = "sk_test_baYdLKFA1rtjMscDkECBVq7Z" | |
} | |
private val sdkSession by lazy { SDKSession() } | |
fun initPayment(onSuccess: () -> Unit) { |
This file contains 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
if (homeData.size() > 0) { | |
Collections.sort(homeData, | |
Collections.reverseOrder(new SortedListAdapterCallback<HomeItemModel>(adapter) { | |
@Override | |
public int compare(HomeItemModel o1, HomeItemModel o2) { | |
// arraylist of strings that contoins what the user had slected as hobbies | |
// whihc are the ones that I want them to show always at the top..! | |
if (Hawk.contains("Hobbies")) { |
This file contains 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.TargetApi; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.view.Window; | |
import android.widget.VideoView; |
This file contains 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
23682-23682/com.thechatapp I/>>> user :: kkk | |
23682-23682/com.thechatapp I/>>> pass :: 123456789 | |
// bunch of Headers logs... | |
BODY '{"session":{"application_id":58597,"created_at":"2017-06-04T11:26:52Z","id":163827527,"nonce":728418371,"token":"c2ac7796877ba1b46e4f6bd2e5078b399e00e4e5","ts":1496575611,"updated_at":"2017-06-04T11:26:52Z","user_id":0,"_id":"163827527"}}' | |
23682-23682/com.thechatapp D/Token: c2ac7796877ba1b46e4f6bd2e5078b399e00e4e5 | |
23682-24161/com.thechatapp D/QBASDK: register network listener | |
23682-24161/com.thechatapp D/QBASDK: Connected. Login to chat, currentUser JID: 0-58597, resource: android_ffffffff-9493-3fa8-ed2d-fb243a4ff1b5 | |
23682-24196/com.thechatapp D/SMACK: RECV (0): failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure> |
This file contains 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
// **Order class** | |
public class Order { | |
public static final int FINISHED = 1; | |
public static final int NEW = 2; | |
@SerializedName("status") | |
@Expose |
This file contains 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
// Sub-Orders Class | |
public class Sub_Orders { | |
@SerializedName("id") | |
@Expose |
This file contains 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
// **OrderPresenter class** which extends Order Class (the actual model class) | |
public class OrderPresenter extends Order { | |
String defaultPicture = "https://cdn.pixabay.com/photo/2015/03/04/22/35/head-659652_960_720.png"; | |
public OrderPresenter(Customer customer, String status, float price, String cusPicURL, String firstName, String lastName, Date time, List<ItemsNum> lineItems, List<Sub_Orders> subOrders, Address cusAdress) { | |
super(customer, status, price, cusPicURL, firstName, lastName, time, lineItems, subOrders, cusAdress); |