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
package com.burakiren.restfulapi; | |
import com.google.gson.annotations.Expose; | |
import com.google.gson.annotations.SerializedName; | |
public class gitmodel { | |
@Expose | |
private String login; |
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
Calendar cal = Calendar.getInstance(); | |
try { | |
cal.setTime(new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss").parse("07052016")); | |
} catch (ParseException e) { | |
System.out.println("Parse Exception"); | |
} | |
Intent intent = new Intent(Intent.ACTION_EDIT); | |
intent.setType("vnd.android.cursor.item/event"); | |
intent.putExtra("beginTime", cal.getTimeInMillis()); | |
intent.putExtra("allDay", false); |
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
/* Copyright (c) 2012 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
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
data class ExampleViewState( | |
val isPageLoading: Boolean = false, | |
val isPullToRefresh: Boolean = false, | |
val userData: User? = null, | |
val error: Throwable? = null | |
) { | |
... | |
} |
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
interface ExampleView : MvpView { | |
/** * Emits button clicks as Observables */ | |
fun showUserDataIntent(): Observable<Unit> | |
/** * Render the state in the UI */ | |
fun render(state: ExampleViewState) | |
} |
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
public class ExampleFragment extends Fragment implements ExampleView { | |
@BindView(R.id.userData) TextView userData; | |
@BindView(R.id.loadingView) View loadingView; | |
@BindView(R.id.errorView) TextView errorView; | |
@BindView(R.id.emptyView) View emptyView; | |
@Override public Observable<String> showUserDataIntent() { | |
return ""; | |
} | |
@Override public void render(ExampleViewState viewState) { |
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 com.huawei.hiai.vision.visionkit.common.Frame;//Load the frame class. | |
import com.huawei.hiai.vision.face.FaceComparator;//Load the face comparison class. | |
import com.huawei.hiai.vision.visionkit.face.FaceCompareResult;//Load the face comparison result class. | |
import com.huawei.hiai.vision.common.VisionBase;//Load the static class for connecting to the service. | |
import com.huawei.hiai.vision.common.ConnectionCallback;//Load the callback for connecting to the service. | |
import com.huawei.hiai.vision.common.VisionImage;//Load the VisionImage class. | |
import com.huawei.hiai.vision.visionkit.face.FaceCompareConfiguration;//Load the facial comparison configuration class. |
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
VisionBase.init(MainActivity.this, new ConnectionCallback(){ | |
@Override | |
public void onServiceConnect(){ | |
Log.i(LOG_TAG, "onServiceConnect"); | |
} | |
@Override | |
public void onServiceDisconnect(){ | |
Log.i(LOG_TAG, "onServiceDisconnect"); | |
} |
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
FaceComparator mFaceComparator = new FaceComparator(mContext); | |
VisionImage image1 = null; | |
VisionImage image2 = null; | |
if (bitmapFirst != null) { | |
image1 = VisionImage.fromBitmap(bitmapFirst); | |
} | |
if (bitmapSecond != null) { | |
image2 = VisionImage.fromBitmap(bitmapSecond); | |
} |
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
try { | |
Float confidence = mFaceCompareResult.isSamePerson(); | |
boolean samePerson = mFaceCompareResult.getSocre(); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} |
OlderNewer