tarlanahad / SimpleCompass

A beautifully designed simple Android Compass Implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SimpleCompass

A beautifully designed simple Android Compass Implementation

Screenshots

screenshot_1518947634

screenshot_1518947719


Import

Add it in your root build.gradle at the end of repositories:

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
}

And on module build.gradle:

dependencies {
	        compile 'com.github.tarlanahad:SimpleCompass:1.0'
}

In your AndroidManifest.xml file add:

<activity
            android:name="com.tarlanahad.simplecompass.Activities.CompassActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

Finally, to start the activity, build Simple Compass like this:

new SimpleCompass().Builder(this)
                .withDestination(fromLocation, toLocation)
                .setContainerBackgroundColor(Color.WHITE)
                .setInfoText("Bearing from location A is ")
                .setCircleColor(Color.BLACK)
                .setCurrentDegreeColor(Color.BLACK)
                .setInfoTextColor(Color.BLACK)
                .setFinishActivityButtonColor(Color.BLACK)
                .setArrowColor(Color.DKGRAY)
                .build();

Important

To show the Views related to the destination such as bearing and arrow , the codes below have to be written.

                .withDestination(fromLocation, toLocation)
                .setInfoText("Bearing from location A is ")

About

A beautifully designed simple Android Compass Implementation


Languages

Language:Java 100.0%