Android satellite menu implementation, XML file states Missing resource

Firstly, I am trying to use this library and I am trying to compile a basic test program: https://github.com/siyamed/android-satellite-menu

I saved the project to my hard drive and imported it into Eclipse. I also made sure it compiles with Java 1.6 and is set to "is library". The actual library is installed in Eclipse without any errors.

As for my project, I followed the instructions listed on GitHub, but I am getting these errors from my XML file:

Multiple annotations found at this line:
    - error: No resource identifier found for attribute 'satelliteDistance' in package 'android.view.ext'
    - error: No resource identifier found for attribute 'mainImage' in package 'android.view.ext'
    - error: No resource identifier found for attribute 'closeOnClick' in package 
     'android.view.ext'
    - error: No resource identifier found for attribute 'expandDuration' in package 
     'android.view.ext'
    - error: No resource identifier found for attribute 'totalSpacingDegree' in package 'android.view.ext'

      

Here's the whole XML file:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sat="http://schemas.android.com/apk/res/android.view.ext"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<android.view.ext.SatelliteMenu
    android:id="@+id/menu"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|left" 
    android:layout_margin="8dp"
    sat:satelliteDistance="170dp"
    sat:mainImage="@drawable/ic_launcher"
    sat:totalSpacingDegree="90"
    sat:closeOnClick="true"
    sat:expandDuration="500"/>

</FrameLayout>

      

And my Java source file:

package com.example.test_satellite_menu;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.ext.SatelliteMenu;
import android.view.ext.SatelliteMenuItem;

public class MainActivity extends Activity {
SatelliteMenu menu = (SatelliteMenu) findViewById(R.id.menu);
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    List<SatelliteMenuItem> items = new ArrayList<SatelliteMenuItem>();
    items.add(new SatelliteMenuItem(4, R.drawable.ic_launcher));
    items.add(new SatelliteMenuItem(4, R.drawable.ic_launcher));
    items.add(new SatelliteMenuItem(4, R.drawable.ic_launcher));
    items.add(new SatelliteMenuItem(3, R.drawable.ic_launcher));
    items.add(new SatelliteMenuItem(2, R.drawable.ic_launcher));
    items.add(new SatelliteMenuItem(1, R.drawable.ic_launcher));
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}
}

      

I made sure my test project has a satellite menu library and I used "fix project properties" as well as "clean project" so now I have no idea :) Any feedback on getting this to work would be awesome ... Thank!


Found my own answer after some more reading via StackOverflow. Had to change the package name android.view.awt to the package name of my current project.

+3


source to share


3 answers


Found my own answer after some more reading via StackOverflow. Had to change the package name android.view.awt to the package name of my current project.



+2


source


<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:sat="http://schemas.android.com/apk/res/com.example.android.activities"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center_horizontal"
    android:layout_weight="0.10"
    >

    <com.example.android.activities.SatelliteMenu
        android:id="@+id/satteliteMenu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|center_horizontal"
        android:layout_margin="8dp"
        sat:closeOnClick="false"
        sat:expandDuration="500"
        sat:mainImage="@drawable/ic_launcher"
        sat:satelliteDistance="130dp"
        sat:totalSpacingDegree="180" />
</FrameLayout>

      



Change the xmlns and add your project name after / res / .. and clean up your project.

+1


source


     SatelliteMenu menu = (SatelliteMenu) findViewById(R.id.satelliteMenu1);
     float distance = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,            170, getResources().getDisplayMetrics());
              menu.setSatelliteDistance((int) distance);
              menu.setExpandDuration(300);
              menu.setCloseItemsOnClick(true);
              menu.setTotalSpacingDegree(120);

    List<SatelliteMenuItem> items = new ArrayList<SatelliteMenuItem>();
    items.add(new SatelliteMenuItem(6, R.drawable.ic_action_search));
    items.add(new SatelliteMenuItem(5, R.drawable.ic_action_search));
    items.add(new SatelliteMenuItem(4, R.drawable.ic_action_search));
    items.add(new SatelliteMenuItem(3, R.drawable.ic_action_search));
    items.add(new SatelliteMenuItem(2, R.drawable.ic_action_search));
    items.add(new SatelliteMenuItem(1, R.drawable.ic_action_search));
    menu.addItems(items);  

      

0


source







All Articles