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
private void deleteTodoItem() { | |
//Swipe to delete currentTodo Item | |
new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, | |
ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) { | |
//private Drawable icon = ContextCompat.getDrawable(getApplicationContext(),R.drawable.icon_delete); | |
private ColorDrawable background = new ColorDrawable(Color.RED); | |
@Override |
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 void deleteCurrentTodoItem(final int position) { | |
mRealm.executeTransaction(new Realm.Transaction() { | |
@Override | |
public void execute(Realm realm) { | |
//needed appropriate action for db manipulation | |
//I've used realmDb so, use next line if your using realmDb | |
//and need to deleteItem from db | |
//otherwise write your code to implement required functionality | |
mRealmTodoList.deleteFromRealm(position); | |
notifyDataSetChanged(); |
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
StorageReference fileRef = mStorageRef.child(System.currentTimeMillis() + "." + "jpg"); | |
fileRef.putFile(mImageUri) | |
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { | |
@Override | |
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { | |
//upload success in firebase storage | |
Toast.makeText(MainActivity.this, "Upload success", Toast.LENGTH_SHORT).show(); | |
//setup to get download url | |
Task<Uri> downloadUri = taskSnapshot.getMetadata().getReference().getDownloadUrl(); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<ImageView | |
android:id="@+id/imageView" |
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
package com.theappnerds.zoomview; | |
import android.graphics.PointF; | |
import android.view.MotionEvent; | |
import android.view.View; | |
public class ZoomView { | |
float[] lastEvent = null; | |
float d = 0f; |
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.widget.ImageView; | |
import androidx.appcompat.app.AppCompatActivity; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
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
[ | |
{ | |
"empId": 1, | |
"name": "John", | |
"city": "Satara", | |
"salary" : 1000.0 | |
}, | |
{ | |
"empId": 2, | |
"name": "Jane", |
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
[HttpGet("TestGithub/{userName}")] | |
public async Task<IActionResult> TestGithub(string userName) | |
{ | |
var httpClient = new HttpClient | |
{ | |
BaseAddress = new Uri("http://api.github.com/"), | |
DefaultRequestHeaders = | |
{ | |
{ "Accept", "application/vnd.github.v3+json" }, |
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 void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllers(); | |
//configure httpclient service | |
services.AddHttpClient("GithubAPI", client=> | |
{ | |
//customize as per your need | |
client.BaseAddress = new Uri("http://api.github.com/"); | |
client.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json"); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
namespace TestAPIGithub.Controllers | |
{ |